From 87ba6a9af03bda455d1035bc1b0c8a0e1f8ffbd0 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Mon, 22 Apr 2019 21:10:38 +0300 Subject: [PATCH] Drop selection on ESC in fitting pane --- gui/builtinViews/fittingView.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gui/builtinViews/fittingView.py b/gui/builtinViews/fittingView.py index ce6d80e76..c55c465f1 100644 --- a/gui/builtinViews/fittingView.py +++ b/gui/builtinViews/fittingView.py @@ -284,7 +284,10 @@ class FittingView(d.Display): def kbEvent(self, event): keycode = event.GetKeyCode() - if keycode == 65 and wx.GetMouseState().cmdDown: + mstate = wx.GetMouseState() + if keycode == wx.WXK_ESCAPE and not mstate.cmdDown and not mstate.altDown and not mstate.shiftDown: + self.unselectAll() + if keycode == 65 and mstate.cmdDown and not mstate.altDown and not mstate.shiftDown: self.selectAll() if keycode == wx.WXK_DELETE or keycode == wx.WXK_NUMPAD_DELETE: modules = [m for m in self.getSelectedMods() if not m.isEmpty]