From ae84696341096859ccc9f3cc43c8102af7fbdd30 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 29 May 2021 13:18:20 -0400 Subject: [PATCH] Fix shift-modified hotkeys in GTK (thanks Ian) Fixes https://gitlab.com/kicad/code/kicad/-/issues/1809 --- common/tool/tool_dispatcher.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index 5b3620bfd2..70718933ef 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -508,6 +508,18 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) wxLogTrace( kicadTraceKeyEvent, "TOOL_DISPATCHER::DispatchWxEvent %s", dump( *ke ) ); +#ifdef __WXGTK__ + // Do not process wxEVT_CHAR_HOOK for a shift-modified key, as ACTION_MANAGER::RunHotKey + // will run the un-shifted key and that's not what we want. Wait to get the translated + // key from wxEVT_CHAR. + // See https://gitlab.com/kicad/code/kicad/-/issues/1809 + if( type == wxEVT_CHAR_HOOK && ke->GetModifiers() == wxMOD_SHIFT ) + { + aEvent.Skip(); + return; + } +#endif + keyIsEscape = ( ke->GetKeyCode() == WXK_ESCAPE ); wxTextEntry* textEntry = dynamic_cast( focus );