Use GetModifiers() instead of asking status of individual keys

This commit is contained in:
DarkPhoenix
2019-04-27 14:22:09 +03:00
parent a919510d07
commit e865c9a399
15 changed files with 54 additions and 51 deletions

View File

@@ -97,11 +97,11 @@ class CommandView(d.Display):
def kbEvent(self, event):
keycode = event.GetKeyCode()
mstate = wx.GetMouseState()
if keycode == wx.WXK_ESCAPE and not mstate.cmdDown and not mstate.altDown and not mstate.shiftDown:
if keycode == wx.WXK_ESCAPE and mstate.GetModifiers() == wx.MOD_NONE:
self.unselectAll()
if keycode == 65 and mstate.cmdDown and not mstate.altDown and not mstate.shiftDown:
elif keycode == 65 and mstate.GetModifiers() == wx.MOD_CONTROL:
self.selectAll()
if keycode == wx.WXK_DELETE or keycode == wx.WXK_NUMPAD_DELETE:
elif keycode == wx.WXK_DELETE or keycode == wx.WXK_NUMPAD_DELETE:
commandFits = self.getSelectedCommandFits()
self.removeCommandFits(commandFits)
event.Skip()