Fix beep on hotkey press in OS X

This commit is contained in:
Collin Anderson 2016-05-05 11:34:16 -04:00 committed by Chris Pavlina
parent 06637a17d6
commit 08b52131df
1 changed files with 11 additions and 0 deletions

View File

@ -323,7 +323,18 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
m_toolMgr->ProcessEvent( *evt ); m_toolMgr->ProcessEvent( *evt );
// pass the event to the GUI, it might still be interested in it // pass the event to the GUI, it might still be interested in it
#ifdef __APPLE__
// On OS X, key events are always meant to be caught. An uncaught key event is assumed
// to be a user input error by OS X (as they are pressing keys in a context where nothing
// is there to catch the event). This annoyingly makes OS X beep and/or flash the screen
// in pcbnew and the footprint editor any time a hotkey is used. The correct procedure is
// to NOT pass key events to the GUI under OS X.
if( type != wxEVT_CHAR )
aEvent.Skip();
#else
aEvent.Skip(); aEvent.Skip();
#endif
updateUI(); updateUI();
} }