Do not check key states for non-key events in TryBefore
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10127
This commit is contained in:
parent
20bbf9b179
commit
2306d00c89
|
@ -96,23 +96,26 @@ bool PCB_BASE_EDIT_FRAME::TryBefore( wxEvent& aEvent )
|
||||||
{
|
{
|
||||||
static bool s_switcherShown = false;
|
static bool s_switcherShown = false;
|
||||||
|
|
||||||
if( !s_switcherShown && wxGetKeyState( WXK_RAW_CONTROL ) && wxGetKeyState( WXK_TAB ) )
|
if( aEvent.GetEventType() == wxEVT_CHAR || aEvent.GetEventType() == wxEVT_CHAR_HOOK )
|
||||||
{
|
{
|
||||||
if( m_appearancePanel && this->IsActive() )
|
if( !s_switcherShown && wxGetKeyState( WXK_RAW_CONTROL ) && wxGetKeyState( WXK_TAB ) )
|
||||||
{
|
{
|
||||||
const wxArrayString& mru = m_appearancePanel->GetLayerPresetsMRU();
|
if( m_appearancePanel && this->IsActive() )
|
||||||
EDA_VIEW_SWITCHER switcher( this, mru );
|
{
|
||||||
|
const wxArrayString& mru = m_appearancePanel->GetLayerPresetsMRU();
|
||||||
|
EDA_VIEW_SWITCHER switcher( this, mru );
|
||||||
|
|
||||||
s_switcherShown = true;
|
s_switcherShown = true;
|
||||||
switcher.ShowModal();
|
switcher.ShowModal();
|
||||||
s_switcherShown = false;
|
s_switcherShown = false;
|
||||||
|
|
||||||
int idx = switcher.GetSelection();
|
int idx = switcher.GetSelection();
|
||||||
|
|
||||||
if( idx >= 0 && idx < (int) mru.size() )
|
if( idx >= 0 && idx < (int) mru.size() )
|
||||||
m_appearancePanel->ApplyLayerPreset( mru[idx] );
|
m_appearancePanel->ApplyLayerPreset( mru[idx] );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue