Make alt key slightly better on windows

This commit is contained in:
Marek Roszko 2021-09-05 22:12:59 -04:00
parent a8d00bf088
commit 0ee79834bb
2 changed files with 22 additions and 1 deletions

View File

@ -1256,3 +1256,17 @@ void EDA_BASE_FRAME::onSystemColorChange( wxSysColourChangedEvent& aEvent )
// Skip the change event to ensure the rest of the window controls get it
aEvent.Skip();
}
#ifdef __WXWINDOWS__
WXLRESULT EDA_BASE_FRAME::MSWWindowProc( WXUINT message, WXWPARAM wParam, WXLPARAM lParam )
{
// This will help avoid the menu keeping focus when the alt key is released
// You can still trigger accelerators as long as you hold down alt
if( message == WM_SYSCOMMAND )
if( wParam == SC_KEYMENU && ( lParam >> 16 ) <= 0 )
return 0;
return wxFrame::MSWWindowProc( message, wParam, lParam );
}
#endif

View File

@ -682,7 +682,14 @@ private:
*/
virtual bool IsModal() const { return false; }
protected:
#ifdef __WXWINDOWS__
/**
* Windows specific override of the wxWidgets message handler for a window
*/
WXLRESULT MSWWindowProc( WXUINT message, WXWPARAM wParam, WXLPARAM lParam ) override;
#endif
protected:
FRAME_T m_ident; // Id Type (pcb, schematic, library..)
wxPoint m_framePos;
wxSize m_frameSize;