Open osrf-migration opened 9 years ago
Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).
Issue #2007 was caused by GLWidget::keyReleaseEvent
not being called when a shortcut is released. i.e.:
Press Crtrl
-> GLWidget::keyPressEvent
is called
Press T
-> Shortcut is activated and MainWindow::SelectTopic
is called. GLWidget
doesn't get the press event.
Release Ctrl
and T
-> GLWidget
doesn't get the release events.
It looks like the shortcut is swallowing the keypress for T
. As for the releases, if you do Ctrl+M
to open the model editor for example, GLWidget
gets the them. So I think that if a shortcut opens a dialog, the dialog is swallowing the releases.
I tried a couple things which didn't work:
Setting the shortcut context to be the whole application instead of only the window:
Installing an event filter for the TopicSelector
so its events go on to the MainWindow
:
I didn't try anything more involved like actually capturing the events on the dialog, because I think that would be a real pain to implement for every dialog we have, and there might be a more elegant solution.
For now, I propose adding a check for QApplication::keyboardModifiers()
to fix issue #2007 on pull request #2398.
Another fun fact: Qt provides API to get the currently pressed keyboard modifiers, but to check for other keys, we have to filter events. Which is what we're doing... and gets messed up with dialogs...
Original report (archived issue) by Ian Chen (Bitbucket: Ian Chen, GitHub: iche033).
we've been experiencing cases where
common::KeyEvent
'scontrol
variable doesn't get reset on key releasequick workaround for now is to check Qt's control key instead of gazebo one