Take modifier key info from event where possible

This commit is contained in:
DarkPhoenix
2019-10-08 20:50:14 +03:00
parent 9618ece4b4
commit 18d8ed6558
23 changed files with 59 additions and 88 deletions

View File

@@ -281,9 +281,7 @@ class DmgPatternEditor(AuxiliaryFrame):
self.stNotice.SetLabel("Patterns exported to clipboard")
def kbEvent(self, event):
keycode = event.GetKeyCode()
mstate = wx.GetMouseState()
if keycode == wx.WXK_ESCAPE and mstate.GetModifiers() == wx.MOD_NONE:
if event.GetKeyCode() == wx.WXK_ESCAPE and event.GetModifiers() == wx.MOD_NONE:
self.Close()
return
event.Skip()