How to detect faster scrolling than triple wheel in Emacs?

One of the troubling drawbacks of Emacs is its strangely broken OSX inertial scroll mechanism. After multiple digging, the real problem is that Emacs only registers the keys to scroll the mouse wheel in one, two or three increments, that is, wheel-up|down , double-wheel-up|down and triple-wheel-up|down .

However, with faster scrolling, the Mac trackpad generates much larger scroll increments. So, is there a way to generate more accurate scrolling messages that actually reflect the amount of scrollpad scroll?

I am running Emacs 24.0.92 from http://emacsformacosx.com/ .

Relevant .emacs settings:

 (setq redisplay-dont-pause t) (setq mouse-wheel-progressive-speed nil) 

Ultimately, I would like it to be like this:

 (defun up-single () (interactive) (scroll-up 1)) (defun up-double () (interactive) (scroll-up 2)) (defun up-triple () (interactive) (scroll-up 3)) ... (global-set-key [wheel-down] 'up-single) (global-set-key [double-wheel-down] 'up-double) (global-set-key [triple-wheel-down] 'up-triple) ... 
+4
source share
2 answers

Emacs doesn't seem to handle scroll events like OSX. The double- and triple- and the event-click-count Stefan function do not indicate single fast scroll events, but only that several scroll events happened in close sequence. Therefore, when you start scrolling, you get the "number of clicks" 1, then 2, then 3, etc.

In OSX, the trackpad does not emit individual scroll events, such as a mouse wheel. Instead, each event contains a pixel pitch from how far the cursor has moved since the last event. Programs must move their scroll views to a distance proportional to this increment. However, to my knowledge, Emacs scroll events do not contain this increment. Therefore, Emacs in its current form cannot perform inertial scrolling.

PLEASE correct me if I am wrong!

0
source

I don’t understand what you want, but while Emacs only has separate event names for single / double / triple clicks, it actually distinguishes between sequences of 9 clicks. event-click-count can be used to extract this information from an event.

+1
source

Source: https://habr.com/ru/post/1392414/


All Articles