Skip to content

Commit 344ec8d

Browse files
committed
Use command keys for window shortcuts in Qt on OSX
1 parent f524106 commit 344ec8d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/backends/backend_qt5.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
SPECIAL_KEYS = {QtCore.Qt.Key_Control: 'control',
3030
QtCore.Qt.Key_Shift: 'shift',
3131
QtCore.Qt.Key_Alt: 'alt',
32-
QtCore.Qt.Key_Meta: 'super',
32+
QtCore.Qt.Key_Meta: 'cmd',
3333
QtCore.Qt.Key_Return: 'enter',
3434
QtCore.Qt.Key_Left: 'left',
3535
QtCore.Qt.Key_Up: 'up',
@@ -67,7 +67,7 @@
6767
ALT = 1
6868
CTRL = 2
6969
SHIFT = 3
70-
MODIFIER_KEYS = [('super', QtCore.Qt.MetaModifier, QtCore.Qt.Key_Meta),
70+
MODIFIER_KEYS = [('cmd', QtCore.Qt.MetaModifier, QtCore.Qt.Key_Meta),
7171
('alt', QtCore.Qt.AltModifier, QtCore.Qt.Key_Alt),
7272
('ctrl', QtCore.Qt.ControlModifier, QtCore.Qt.Key_Control),
7373
('shift', QtCore.Qt.ShiftModifier, QtCore.Qt.Key_Shift),
@@ -76,10 +76,10 @@
7676
if sys.platform == 'darwin':
7777
# in OSX, the control and super (aka cmd/apple) keys are switched, so
7878
# switch them back.
79-
SPECIAL_KEYS.update({QtCore.Qt.Key_Control: 'super', # cmd/apple key
79+
SPECIAL_KEYS.update({QtCore.Qt.Key_Control: 'cmd', # cmd/apple key
8080
QtCore.Qt.Key_Meta: 'control',
8181
})
82-
MODIFIER_KEYS[0] = ('super', QtCore.Qt.ControlModifier,
82+
MODIFIER_KEYS[0] = ('cmd', QtCore.Qt.ControlModifier,
8383
QtCore.Qt.Key_Control)
8484
MODIFIER_KEYS[2] = ('ctrl', QtCore.Qt.MetaModifier,
8585
QtCore.Qt.Key_Meta)

0 commit comments

Comments
 (0)