Mouse/touchpad protocol enhancements
@egmontkob
Submitted by Egmont Koblinger Link to original bug (#755183)
Description
I'm using a touchpad all the time, and I think mouse/touchpad handling really deserves the following updates. We should cooperate with Thomas and others to come up with a reasonable extension. (Unfortunately there's no public bugtracker for xterm, so I'm filing it here, lest we forget it, and perhaps for a first round of comments before we reach out to him.)
-
Smooth scroll reporting. On normal screen (when dragging the scrollbar), or on alternate screen with no mouse reporting (e.g. "less" when we convert the wheel to Up/Down keypresses) we already recognize smooth movements and send events one by one, rather than multiple of them at once after reaching 1 old unit of scrolling. This is, however, not true for apps that handle the mouse themselves, e.g. mcview. Here scrolling is rough, by 3-4 lines at a time. The mouse protocol should be extended, so that if an app requests it, we should be able to report finegrained motion.
-
Horizontal scrolling. We have vertical, why should also have horizontal just as equally. (Actually, when running "less" where we synthesize keypresses, we could already do this on our own without extending the protocol. But of course I'd also like mcview and friends to have this feature.)
-
Selective events. For some simpler apps (e.g. nano-like text editors) it might make sense to request scroll events, yet ignore clicks and let the terminal handle them the way it wants to.
-
Offscreen values. Pointed out here: http://sourceforge.net/p/joe-editor/patches/111/ an app should be able to recognize when the mouse is being dragged out of the window while its button is held down. This is so that they can handle somehow when the mouse reaches the top or bottom row (e.g. highlight the text), and handle it differently when it moves beyond (e.g. start scrolling).
Okay, the 4th one is not about touchpad, but the first three are. A decade or two ago the mouse wheel was something new and special (let alone touchpads with an easy way of scrolling), something extra compared to the two or three buttons. Nowadays, with laptops with large and good quality touchpad, and with tons of content to consume, I feel that precise scrolling with two fingers became perhaps an even more basic operation that clicking. But at the very least a first class citizen along the lines of clicking or pressing a key. We should treat it accordingly.
Version: git master