Don't process hotkeys on text entries

Thanks @jeffyoung for the suggestion

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4463
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1941
This commit is contained in:
Jon Evans 2020-05-29 21:20:03 -04:00
parent 112316cdfb
commit fbef52ec33
2 changed files with 8 additions and 1 deletions

View File

@ -196,6 +196,10 @@ void EDA_DRAW_FRAME::unitsChangeRefresh()
bool EDA_DRAW_FRAME::DispatchBehindModalDialog( wxKeyEvent& aEvent )
{
// Never process hotkeys when a text entry field is focused
if( dynamic_cast<wxTextEntry*>( FindFocus() ) )
return false;
static std::set<const TOOL_ACTION*> whiteList = { &ACTIONS::toggleUnits,
&ACTIONS::imperialUnits,
&ACTIONS::metricUnits };

View File

@ -483,6 +483,9 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
wxKeyEvent* ke = static_cast<wxKeyEvent*>( &aEvent );
keyIsEscape = ( ke->GetKeyCode() == WXK_ESCAPE );
// Never process key events for tools when a text entry has focus
if( !dynamic_cast<wxTextEntry*>( wxWindow::FindFocus() ) )
evt = GetToolEvent( ke, &keyIsSpecial );
}
else if( type == wxEVT_MENU_OPEN || type == wxEVT_MENU_CLOSE || type == wxEVT_MENU_HIGHLIGHT )