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.
This commit is contained in:
jean-pierre charras 2019-07-08 16:28:45 +02:00
parent 269cd11b5a
commit 1633068920
1 changed files with 6 additions and 0 deletions

View File

@ -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.