Hotkey editor: prevent closing on Enter release

This commit is contained in:
Alex 2021-12-14 21:13:45 +03:00 committed by Seth Hillbrand
parent a86a646eb0
commit 5bf9bd3ebb
1 changed files with 6 additions and 2 deletions

View File

@ -199,8 +199,12 @@ protected:
void OnKeyUp( wxKeyEvent& aEvent )
{
/// This needs to occur in KeyUp, so that we don't pass the event back to pcbnew
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
// If dialog opened using Enter key, prevent closing when releasing Enter.
if( m_event.GetEventType() != wxEVT_NULL )
{
/// This needs to occur in KeyUp, so that we don't pass the event back to pcbnew
wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
}
}
private: