8000 using key_press_handler_id as flag for toolmanager · matplotlib/matplotlib@bd8dd06 · GitHub
[go: up one dir, main page]

Skip to content

Commit bd8dd06

Browse files
author
Federico Ariza
committed
using ke 8000 y_press_handler_id as flag for toolmanager
1 parent d221157 commit bd8dd06

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/widgets.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,8 @@ def _notify_change_observers(self):
856856

857857
def begin_typing(self, x):
858858
self.capturekeystrokes = True
859-
if rcParams['toolbar'] != 'toolmanager':
859+
# Check for toolmanager handling the keypress
860+
if self.ax.figure.canvas.manager.key_press_handler_id is not None:
860861
# disable command keys so that the user can type without
861862
# command keys causing figure to be saved, etc
862863
self.reset_params = {}
@@ -872,7 +873,8 @@ def stop_typing(self):
872873
# user's code, we only want to call it once we've already done
873874
# our cleanup.
874875
if self.capturekeystrokes:
875-
if rcParams['toolbar'] != 'toolmanager':
876+
# Check for toolmanager handling the keypress
877+
if self.ax.figure.canvas.manager.key_press_handler_id is not None:
876878
# since the user is no longer typing,
877879
# reactivate the standard command keys
878880
for key in self.params_to_disable:

0 commit comments

Comments
 (0)
0