File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,7 @@ class _FigureCanvasWxBase(FigureCanvasBase, wx.Panel):
439
439
wx .WXK_CONTROL : 'control' ,
440
440
wx .WXK_SHIFT : 'shift' ,
441
441
wx .WXK_ALT : 'alt' ,
442
+ wx .WXK_CAPITAL : 'caps_lock' ,
442
443
wx .WXK_LEFT : 'left' ,
443
444
wx .WXK_UP : 'up' ,
444
445
wx .WXK_RIGHT : 'right' ,
@@ -718,11 +719,14 @@ def _get_key(self, event):
718
719
else :
719
720
key = None
720
721
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
726
730
727
731
return key
728
732
You can’t perform that action at this time.
0 commit comments