8000 Merge pull request #18172 from ianhi/report-button-correctly · matplotlib/matplotlib@dffc19c · GitHub
[go: up one dir, main page]

Skip to content

Commit dffc19c

Browse files
authored
Merge pull request #18172 from ianhi/report-button-correctly
allow webAgg to report middle click events
2 parents 852c08e + ce8d715 commit dffc19c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
webAgg backend no longer reports a middle click as a right click
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Previously when using the webAgg backend the event passed to a callback
5+
by ``fig.canvas.mpl_connect('mouse_button_event', callback)`` on a middle click
6+
would report `.MouseButton.RIGHT` instead of `.MouseButton.MIDDLE`

lib/matplotlib/backends/backend_webagg_core.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,6 @@ def _handle_mouse(self, event):
260260
# off by 1
261261
button = event['button'] + 1
262262

263-
# The right mouse button pops up a context menu, which
264-
# doesn't work very well, so use the middle mouse button
265-
# instead. It doesn't seem that it's possible to disable
266-
# the context menu in recent versions of Chrome. If this
267-
# is resolved, please also adjust the docstring in MouseEvent.
268-
if button == 2:
269-
button = 3
270-
271263
e_type = event['type']
272264
guiEvent = event.get('guiEvent', None)
273265
if e_type == 'button_press':

0 commit comments

Comments
 (0)
0