TurboVNC / turbovnc

Main TurboVNC repository
https://TurboVNC.org
GNU General Public License v2.0
746 stars 136 forks source link

Add horizontal scrolling support via BUTTON6 and BUTTON7. #416

Closed rsparlin closed 1 week ago

rsparlin commented 1 month ago

Also adds support for Mac touchpads to scroll horizontally, which is indicated by a shift modifier on wheel events.

rsparlin commented 1 month 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.

rsparlin commented 1 month ago

I tested this successfully on a MacBook air (2018) running MacOS Sonoma 14.5.

rsparlin commented 1 month ago

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 MouseWheelEvents occur at all when I scroll horizontally.

dcommander commented 1 month ago

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.

dcommander commented 1 week ago

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.

dcommander commented 1 week ago

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.