Take modifier key info from event where possible
This commit is contained in:
@@ -280,12 +280,12 @@ class FittingView(d.Display):
|
||||
|
||||
def kbEvent(self, event):
|
||||
keycode = event.GetKeyCode()
|
||||
mstate = wx.GetMouseState()
|
||||
if keycode == wx.WXK_ESCAPE and mstate.GetModifiers() == wx.MOD_NONE:
|
||||
modifiers = event.GetModifiers()
|
||||
if keycode == wx.WXK_ESCAPE and modifiers == wx.MOD_NONE:
|
||||
self.unselectAll()
|
||||
elif keycode == 65 and mstate.GetModifiers() == wx.MOD_CONTROL:
|
||||
elif keycode == 65 and modifiers == wx.MOD_CONTROL:
|
||||
self.selectAll()
|
||||
elif keycode in (wx.WXK_DELETE, wx.WXK_NUMPAD_DELETE) and mstate.GetModifiers() == wx.MOD_NONE:
|
||||
elif keycode in (wx.WXK_DELETE, wx.WXK_NUMPAD_DELETE) and modifiers == wx.MOD_NONE:
|
||||
modules = [m for m in self.getSelectedMods() if not m.isEmpty]
|
||||
self.removeModule(modules)
|
||||
event.Skip()
|
||||
|
||||
Reference in New Issue
Block a user