Enhance add support for more than 3 mouse buttons#3229
Enhance add support for more than 3 mouse buttons#3229SlySven merged 3 commits intoMudlet:developmentfrom
Conversation
This applies to the main console window for a profile and now reports all mouse button presses and releases in the `sysWindowMousePressEvent` and `sysWindowMouseReleaseEvent` instead of only the first three (left, right, middle). The code for the same things in Labels was checked and I found that we were generally okay there already except that we were fabricating native Qt mouse events for the mapper where it overlaid a label but we were using an older (Qt4 compatible) event that only handled one mouse wheel at a time and we were assuming it was for a vertical mouse wheel. As the owner of a mouse with two wheels that assumption is misplaced so I have rejigged `(bool) TLabel::forwardEventToMapper(QEvent*)` so that it can pass horizontal and vertical mouse wheel events in the future. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
These include:
* some "else after return" anti-pattern instances that CLazy
will moan about.
* a missing pair of `{`...`}` around a single line of `else` code.
* some missing `[[fallthrough]]` in the `case` labels in a couple of
`switch`es.
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
|
Found out the CI failure was because the newer |
|
Ahh damnit! |
…Qt lib The new constructor I used in the previous commit was only introduced in Qt 5.12. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
vadi2
left a comment
There was a problem hiding this comment.
Works excellent! Reported 0 for those buttons before, now reports a button number.
|
One oddity I found in testing is that you do not get right button (button number 2) release events, but that is not a fault in this PR I believe; perhaps it is down to the way that that event is handled to produce the context menu. Might need further investigation as a separate issue... |
This applies to the main console window for a profile and now reports all mouse button presses and releases in the
sysWindowMousePressEventandsysWindowMouseReleaseEventinstead of only the first three (left, right, middle).The code for the same things in Labels was checked and I found that we were generally okay there already except that we were fabricating native Qt mouse events for the mapper where it overlaid a label but we were using an older (Qt4 compatible) event that only handled one mouse wheel at a time and we were assuming it was for a vertical mouse wheel. As the owner of a mouse with two wheels that assumption is misplaced so I have rejigged
(bool) TLabel::forwardEventToMapper(QEvent*)so that it can pass horizontal and vertical mouse wheel events in the future.This will hopefully help to address #3220 .
Signed-off-by: Stephen Lyons slysven@virginmedia.com