Fix ESC handling with whitelist.

This commit is contained in:
Jeff Young 2020-05-03 15:59:51 +01:00
parent 0370eff7ba
commit a3486b7cd4
2 changed files with 2 additions and 4 deletions

View File

@ -511,9 +511,7 @@ void DIALOG_SHIM::OnButton( wxCommandEvent& aEvent )
void DIALOG_SHIM::OnCharHook( wxKeyEvent& aEvt )
{
// Do not send WXK_ESCAPE char hook event to the parent frame
// It must be handled by the dialog itself
if( m_parentFrame && aEvt.GetKeyCode() != WXK_ESCAPE )
if( m_parentFrame )
{
m_parentFrame->DispatchBehindModalDialog( aEvt );

View File

@ -532,7 +532,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent, std::set<const TOOL_ACTI
handled = m_toolMgr->ProcessEvent( *evt, aWhiteList );
// ESC is the special key for canceling tools, and is therefore seen as handled
if( key == WXK_ESCAPE )
if( key == WXK_ESCAPE && ( !aWhiteList || aWhiteList.count( ACTIONS::cancelInteractive ) ) )
handled = true;
}