fix: SG-41698: Add Alt modifier check for mouse wheel events#1060
fix: SG-41698: Add Alt modifier check for mouse wheel events#1060tjjackson wants to merge 3 commits intoAcademySoftwareFoundation:mainfrom
Conversation
Signed-off-by: TJ Jackson <tj.jackson@dreamworks.com>
bernie-laberge
left a comment
There was a problem hiding this comment.
Thank you @tjjackson !
Signed-off-by: TJ Jackson <tj.jackson@dreamworks.com>
|
@tjjackson I think you forgot to format your code. You can use |
|
Sorry @tjjackson, the formatting error was my bad: the formatter hadn't ran on the code I proposed to you because I never committed it. |
Signed-off-by: TJ Jackson <tj.jackson@dreamworks.com>
|
Yeah I copied-pasted it and didn't think to run pre-commit again, should be good now |
There was a problem hiding this comment.
Pull request overview
This PR updates OpenRV’s Qt event translation so mouse wheel “up/down” direction is derived from the correct QWheelEvent::angleDelta() axis when a horizontal-scroll modifier is pressed (Alt on Linux/Windows, Shift on macOS).
Changes:
- Add platform-specific modifier selection to detect horizontal scrolling for wheel events.
- Use
angleDelta().x()instead ofangleDelta().y()when the horizontal-scroll modifier is active.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Linked issues
Summarize your change.
Added a check for Alt modifier to QTTranslator::sendMouseWheelEvent()
Describe the reason for the change.
The Alt key combined with the mouse wheel triggers horizontal scrolling, and will be reported in angleDelta().x() instead of angleDelta().y(). I added a check for the Alt modifier for whether to use angleDelta().x() or angleDelta().y() as the delta for determining if the wheel is moving down or up.
Describe what you have tested and on which operating system.
Successfully tested on Rocky Linux 9.5
Add a list of changes, and note any that might need special attention during the review.
If possible, provide screenshots.