Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
key events handler return value to True to stop propagation #6397
Conversation
mdboom
added the
needs_review
label
May 11, 2016
fariza
changed the title from
key events handler return value to False to stop propagation to key events handler return value to True to stop propagation
May 11, 2016
|
Qt does not have this notion of a 'callback' chain. Each signal can propagate to 0 or more slots, but they are, my understanding, all independently executed. |
tacaswell
added this to the
2.0 (style change major release)
milestone
May 11, 2016
QuLogic
commented on an outdated diff
May 11, 2016
| @@ -300,14 +300,14 @@ def key_press_event(self, widget, event): | ||
| key = self._get_key(event) | ||
| if _debug: print("hit", key) | ||
| FigureCanvasBase.key_press_event(self, key, guiEvent=event) | ||
| - return False # finish event propagation? | ||
| + return True # stoping event propagation |
|
|
|
@tacaswell Qt's signals/slots mechanism is separate from its event handling (like keyboard events). Qt's event handling does have the notion of stopping the propagating of events. |
|
@dopplershift |
|
On a bit further reading, the notion of event propagation is handled by the method |
|
So with the changes in this PR we are at the same level that Qt |
tacaswell
merged commit 37a3baf
into matplotlib:master
May 12, 2016
tacaswell
removed the
needs_review
label
May 12, 2016
tacaswell
referenced
this pull request
May 12, 2016
Closed
Down arrow on GTK3 backends selects toolbar, which eats furthur keypress events #6349
tacaswell
added a commit
that referenced
this pull request
May 12, 2016
|
|
tacaswell |
9b39f3e
|
|
backported to 2.x as 9b39f3e |
fariza commentedMay 11, 2016
Fixing #6349
Right now only stopping the key press and key release event from propagating after callback.
I am in doubt about the other events, should be stopped also?
@tacaswell how does it work in Qt?