From 1633068920e2d6df6fe37fb496966f733d1d53ef Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 8 Jul 2019 16:28:45 +0200 Subject: [PATCH] tool_dispatcher.cpp: fix incorrect handling of ESC key on Linux and Windows. m_toolMgr->ProcessEvent() returns false when a ESC key is handled. It should return true. So we force the handled flag to true for a ESC key event to avoid skipping this event. Otherwise the ESC key event is handled twice. --- common/tool/tool_dispatcher.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index dde951573d..e556a600fb 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -462,8 +462,14 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) bool handled = false; if( evt ) + { handled = m_toolMgr->ProcessEvent( *evt ); + // ESC is the special key for canceling tools, and is therefore seen as handled + if( key == WXK_ESCAPE ) + handled = true; + } + // pass the event to the GUI, it might still be interested in it // Note wxEVT_CHAR_HOOK event is already skipped for special keys not used by KiCad // and wxEVT_LEFT_DOWN must be always Skipped.