Skip to content

Commit fde6ea1

Browse files
anntzerbrunobeltran
authored andcommitted
Restore special-casing of 'control'.
1 parent 8fd4f9b commit fde6ea1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/backends/backend_qt5.py

+4-1
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)