Skip to content

Commit 7c400e9

Browse files
authored
Merge pull request #16892 from anntzer/mouseevent-key
Warn in the docs that MouseEvent.key can be wrong.
2 parents b26b184 + 23a0b3d commit 7c400e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,12 @@ class MouseEvent(LocationEvent):
13691369
The key pressed when the mouse event triggered, e.g. 'shift'.
13701370
See `KeyEvent`.
13711371
1372+
.. warning::
1373+
This key is currently obtained from the last 'key_press_event' or
1374+
'key_release_event' that occurred within the canvas. Thus, if the
1375+
last change of keyboard state occurred while the canvas did not have
1376+
focus, this attribute will be wrong.
1377+
13721378
step : int
13731379
The number of scroll steps (positive for 'up', negative for 'down').
13741380
This applies only to 'scroll_event' and defaults to 0 otherwise.

0 commit comments

Comments
 (0)