QShortcut blocks keyPressEvent
-
wrote 28 days ago last edited by
Hi,
I've set up some configurable QShortcuts in our project. They are then attached to the QWindow.
I also use keyPressEvents to get normal user input in the window.The problem is that as soon as the user presses a shortcut, there is no propagation of the keyPressEvent anymore.
So for example if you press Shift+M and a shortcut is setup for that, then there will only be a Shift event but no M event. The shortcut works of course, but now it's impossible for the user to enter uppercase M unless they use capslock.Is there a way to tell QShortcut to keep propagating the event?
-
Hi,
I've set up some configurable QShortcuts in our project. They are then attached to the QWindow.
I also use keyPressEvents to get normal user input in the window.The problem is that as soon as the user presses a shortcut, there is no propagation of the keyPressEvent anymore.
So for example if you press Shift+M and a shortcut is setup for that, then there will only be a Shift event but no M event. The shortcut works of course, but now it's impossible for the user to enter uppercase M unless they use capslock.Is there a way to tell QShortcut to keep propagating the event?
wrote 28 days ago last edited by Pl45m4Hi,
QEvent::ShortcutOverride
might be the right thing for you in this case.
(override the shortcut when typing text) -
wrote 27 days ago last edited by
Thank you!
I'll take a look and report back
2/3