From 5e9944516dc49247a7b9b1948476d5b3ca4c2924 Mon Sep 17 00:00:00 2001 From: Shuvam Date: Mon, 10 Feb 2025 23:58:58 +0530 Subject: [PATCH] Add check to skip key interception in OnGlobalkey OnGlobalkey was intercepting the shortcuts defined for save and quit and hence they were not working. Added exception to skip these keys. --- invesalius/gui/frame.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/invesalius/gui/frame.py b/invesalius/gui/frame.py index fa65b8e7f..95b28bc5c 100644 --- a/invesalius/gui/frame.py +++ b/invesalius/gui/frame.py @@ -192,6 +192,14 @@ def OnGlobalKey(self, event): Handle all key events at a global level. """ keycode = event.GetKeyCode() + modifiers = event.GetModifiers() + + # If it is CTRL+S, CTRL+Shift+S, or CTRL+Q, skip this event + if modifiers & wx.MOD_CONTROL: + unicode = event.GetUnicodeKey() + if unicode in (ord("s"), ord("S"), ord("q"), ord("Q")): + event.Skip() + return # If the key is a move marker key, publish a message to move the marker. if keycode in const.MOVEMENT_KEYCODES and not self.edit_data_notebook_label: