Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59074a6

Browse files
committed
Restore special-casing of 'control'.
1 parent 820b0d6 commit 59074a6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/matplotlib/backends/backend_qt5.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,12 @@ def _get_key(self, event):
387387
event_mods = int(event.modifiers()) # actually a bitmask
388388

389389
# get names of the pressed modifier keys
390+
# 'control' is named 'control' when a standalone key, but 'ctrl' when a
391+
# modifier
390392
# bit twiddling to pick out modifier keys from event_mods bitmask,
391393
# if event_key is a MODIFIER, it should not be duplicated in mods
392-
mods = [SPECIAL_KEYS[key] for mod, key in _MODIFIER_KEYS
394+
mods = [SPECIAL_KEYS[key].replace('control', 'ctrl')
395+
for mod, key in _MODIFIER_KEYS
393396
if event_key != key and event_mods & mod]
394397
try:
395398
# for certain keys (enter, left, backspace, etc) use a word for the

0 commit comments

Comments
 (0)