Closed megies closed 1 year ago
After wondering what happened to this ticket and coming back, I realized that this was likely reported in the wrong place, see #32
For what it's worth, turns out this is intended (but not well documented) behavior. Alt key modifier simulates horizontal scrolling and the scrolling value can be found in angleDelta().x()
instead in that case.
Problem description
I have a PyQt GUI application that does some zooming around in various fashions based on mouse wheel events in combination with different keyboard modifiers influencing behavior.
At some point zooming with "Alt" key modifier (i.e. key held down while scrolling wheel) stopped working (could have even been back on PyQt4 but it definitely worked at some point). I did not have time to investigate at that point but came back to the issue now.
It seems there is a bug whenever "Alt" key is held down the
angleDelta().y()
is0
instead of the usual120
or-120
for common mice for one scroll tick up/down. This means wheel events can not be used with Alt key held down, since they its core information (wheel direction).If this is an upstream problem of Qt, please let me know how to best report it there, as I exclusively use Qt via PyQt.
To reproduce:
Expected outcome
When holding down Alt key, the reported angle on mouse wheel zoom should be the same as without modifiers or using other modifiers like shift etc. In this example it should be 120 like without alt key held down.
Code to reproduce
Screenshots
1: wheel up, no key held
2: wheel up, shift key held
3: wheel up, alt key held
Version info