Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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
Tom1
Messages: 1282
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 messageGo to next message
Tom1
Messages: 1282
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
  • Attachment: Win32Proc.cpp
    (Size: 20.45KB, Downloaded 1248 times)

[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
Tom1
Messages: 1282
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 1219 times)

[Updated on: Wed, 24 January 2024 16:27]

Report message to a moderator

Previous Topic: Outdated tools in Windows package
Next Topic: Fastest way to capture control as image
Goto Forum:
  


Current Time: Fri Dec 13 22:50:50 CET 2024

Total time taken to generate the page: 0.03090 seconds