8000 MNT: Remove key_press and button_press from FigureManager by greglucas · Pull Request #23079 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

MNT: Remove key_press and button_press from FigureManager #23079

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
May 20, 2022
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions doc/api/next_api_changes/removals/23079-GL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
``key_press`` and ``button_press`` have been removed from FigureManager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Trigger the events directly on the canvas using
``canvas.callbacks.process(event.name, event)`` for key and button events.
17 changes: 0 additions & 17 deletions lib/matplotlib/backend_bases.py
7495
Original file line number Diff line number Diff line change
Expand Up @@ -2816,23 +2816,6 @@ def full_screen_toggle(self):
def resize(self, w, h):
"""For GUI backends, resize the window (in physical pixels)."""

@_api.deprecated(
"3.4", alternative="self.canvas.callbacks.process(event.name, event)")
def key_press(self, event):
"""
Implement the default Matplotlib key bindings defined at
:ref:`key-event-handling`.
"""
if rcParams['toolbar'] != 'toolmanager':
key_press_handler(event)

@_api.deprecated(
"3.4", alternative="self.canvas.callbacks.process(event.name, event)")
def button_press(self, event):
"""The default Matplotlib button actions for extra mouse buttons."""
if rcParams['toolbar'] != 'toolmanager':
button_press_handler(event)

def get_window_title(self):
"""
Return the title text of the window containing the figure, or None
Expand Down
0