Skip to content

Warn in the docs that MouseEvent.key can be wrong. #16892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,12 @@ class MouseEvent(LocationEvent):
The key pressed when the mouse event triggered, e.g. 'shift'.
See `KeyEvent`.

.. warning::
This key is currently obtained from the last 'key_press_event' or
'key_release_event' that occurred within the canvas. Thus, if the
last change of keyboard state occurred while the canvas did not have
focus, this attribute will be wrong.

step : int
The number of scroll steps (positive for 'up', negative for 'down').
This applies only to 'scroll_event' and defaults to 0 otherwise.
Expand Down