File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -439,6 +439,7 @@ class _FigureCanvasWxBase(FigureCanvasBase, wx.Panel):
439439 wx .WXK_CONTROL : 'control' ,
440440 wx .WXK_SHIFT : 'shift' ,
441441 wx .WXK_ALT : 'alt' ,
442+ wx .WXK_CAPITAL : 'caps_lock' ,
442443 wx .WXK_LEFT : 'left' ,
443444 wx .WXK_UP : 'up' ,
444445 wx .WXK_RIGHT : 'right' ,
@@ -718,11 +719,14 @@ def _get_key(self, event):
718719 else :
719720 key = None
720721
721- for meth , prefix in (
722- [event .AltDown , 'alt' ],
723- [event .ControlDown , 'ctrl' ], ):
724- if meth ():
725- key = '{0}+{1}' .format (prefix , key )
722+ for meth , prefix , key_name in (
723+ [event .ControlDown , 'ctrl' , 'control' ],
724+ [event .AltDown , 'alt' , 'alt' ],
725+ [event .ShiftDown , 'shift' , 'shift' ],):
726+ if meth () and not key_name == key :
727+ if not (key_name == 'shift' and key .isupper ()):
728+ key = '{0}+{1}' .format (prefix , key )
729+ break
726730
727731 return key
728732
You can’t perform that action at this time.
0 commit comments