There was an error while loading. Please reload this page.
2 parents 852c08e + ce8d715 commit dffc19cCopy full SHA for dffc19c
2 files changed
doc/api/next_api_changes/behavior/18172-IHI.rst
@@ -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
@@ -260,14 +260,6 @@ def _handle_mouse(self, event):
260
# off by 1
261
button = event['button'] + 1
262
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
-
271
e_type = event['type']
272
guiEvent = event.get('guiEvent', None)
273
if e_type == 'button_press':
0 commit comments