Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 doc/api/next_api_changes/behavior/18172-IHI.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
webAgg backend no longer reports a middle click as a right click
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment thread
ianhi marked this conversation as resolved.
Resolved

Previously when using the webAgg backend the event passed to a callback
by `fig.canvas.mpl_connect('mouse_button_event', callback)` on a middle click
Comment thread
ianhi marked this conversation as resolved.
Resolved
would report `MouseButton.RIGHT` instead of `MouseButton.MIDDLE`
Comment thread
ianhi marked this conversation as resolved.
Resolved
8 changes: 0 additions & 8 deletions lib/matplotlib/backends/backend_webagg_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,6 @@ def _handle_mouse(self, event):
# off by 1
button = event['button'] + 1

# The right mouse button pops up a context menu, which
# doesn't work very well, so use the middle mouse button
# instead. It doesn't seem that it's possible to disable
# the context menu in recent versions of Chrome. If this
# is resolved, please also adjust the docstring in MouseEvent.
if button == 2:
button = 3

e_type = event['type']
guiEvent = event.get('guiEvent', None)
if e_type == 'button_press':
Expand Down