Closed rsparlin closed 1 week ago
Suggestions for improvement welcomed.
If I have time I'll see about testing the behavior of horizontal scrolling using the java client on windows/linux. It may also be indicated with a shift modifier.
I tested this successfully on a MacBook air (2018) running MacOS Sonoma 14.5.
I tested this (without the isMac check) on Debian 12 built/run using OpenJDK (build 17.0.11+9-Debian-1deb12u1), and it does not appear that horizontal scrolling is indicated with a shift modifier on wheel events. In fact, it seems that no MouseWheelEvent
s occur at all when I scroll horizontally.
Yeah, there is a lot of variation in how different operating systems handle horizontal scroll and the up and down buttons. I have been meaning to look into it in more detail.
Your patch works perfectly for Mac clients and enables horizontal scrolling both with a trackpad and with a side-to-side click of the scroll wheel on mice that support it (such as the Logitech mouse I use.) I am investigating how to do something similar for Linux and Windows clients.
Implemented in https://github.com/TurboVNC/turbovnc/commit/32f59696f96755dd223e36129b4f2736f8e10f20. For me at least, it works on Windows and macOS clients (both of which use Shift + vertical scroll wheel events to represent horizontal scroll wheel events) and X11 clients (which use Buttons 6 and 7 to emulate left and right scroll wheel events.)
Please test.
Also adds support for Mac touchpads to scroll horizontally, which is indicated by a shift modifier on wheel events.