Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Horizontal Mouse Wheel support request
Horizontal Mouse Wheel support request [message #60405] |
Tue, 02 January 2024 15:07 ![Go to next message Go to next message](theme/default/images/down.png) |
Tom1
Messages: 1221 Registered: March 2007
|
Senior Contributor |
|
|
Hi,
Can we get support for horizontal mouse wheel in CtrlCore?
A prototype implementation in CtrlCore for Windows is attached in the zip file.
The horizontal scrolling is needed to support two finger panning of documents (or maps in my case) on laptop touch pads as a pair for two finger zoom which already automatically maps to Ctrl + MouseWheel.
Best regards,
Tom
|
|
|
Re: Horizontal Mouse Wheel support request [message #60443 is a reply to message #60405] |
Wed, 24 January 2024 13:51 ![Go to previous message Go to previous message](theme/default/images/up.png) ![Go to next message Go to next message](theme/default/images/down.png) |
Tom1
Messages: 1221 Registered: March 2007
|
Senior Contributor |
|
|
Hi Again,
Due to the fact that with a regular mouse the horizontal wheel scrolling is commonly simulated through 'Shift + Mouse Wheel' I decided to introduce a simpler lightweight implementation for Horizontal Mouse Wheel support in Windows. It requires only minimal changes in CtrlCore/Win32Proc.cpp, which you can find attached. (No changes at all in CtrlCore.h or CtrlMouse.cpp, like in the previous solution.)
So, there is no added MouseWheelHor() method, but instead the horizontal wheel comes in through regular MouseWheel() with keyflags |= K_SHIFT, which is the common horizontal wheel simulation solution anyway. Therefore, both simulated and real horizontal wheel events become available in MouseWheel().
NOTE: The attached CtrlCore/Win32Proc.cpp also attempts to fix a touch screen issue with Pen aware apps by slightly adjusting the Pen detection mask. This is based on pen/touch differentiation as per:
https://learn.microsoft.com/en-us/windows/win32/tablet/syste m-events-and-mouse-messages?redirectedfrom=MSDN
Best regards,
Tom
[Updated on: Thu, 25 January 2024 09:00] Report message to a moderator
|
|
|
Re: Horizontal Mouse Wheel support request [message #60444 is a reply to message #60443] |
Wed, 24 January 2024 16:03 ![Go to previous message Go to previous message](theme/default/images/up.png) |
Tom1
Messages: 1221 Registered: March 2007
|
Senior Contributor |
|
|
Hi,
Please find attached the code for GTK in CtrlCore/GtkEvent.cpp. The implementation generally works the same as in Windows, but the granularity is fixed to 120 as it was before. (In Windows we can actually get smaller values too when using two finger gestures on touch pad, making the scrolling proportional to movement. I could not find a way to do that on GTK yet -- partly because I do not have Linux installed on a laptop with touch pad.)
Please note that these implementations use Windows native scrolling directions (i.e. Positive values are received with Up/Forward and Right wheel movement):
https://learn.microsoft.com/en-us/windows/win32/inputdev/wm- mousewheel#parameters
https://learn.microsoft.com/en-us/windows/win32/inputdev/wm- mousehwheel#parameters
I soon found out that horizontal scrolling via 'Shift + MouseWheel' is already supported within some U++ controls, but unfortunately the horizontal direction is reversed having positive going left. I think this should be corrected in those U++ Ctrls that support horizontal scrolling via 'Shift + MouseWheel'.
Best regards,
Tom
EDIT: Did small cleanup for GtkEvent.cpp.
-
Attachment: GtkEvent.cpp
(Size: 22.68KB, Downloaded 1202 times)
[Updated on: Wed, 24 January 2024 16:27] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Sep 01 07:18:52 CEST 2024
Total time taken to generate the page: 0.00473 seconds
|