Allow exclusive-or selections on OSX.

This commit is contained in:
Jeff Young 2019-12-29 19:40:18 +00:00
parent 7c61b83df6
commit e03281a9ae
1 changed files with 6 additions and 0 deletions

View File

@ -192,12 +192,18 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
bool dragAlwaysSelects = getEditFrame<PCB_BASE_FRAME>()->GetDragSelects(); bool dragAlwaysSelects = getEditFrame<PCB_BASE_FRAME>()->GetDragSelects();
m_additive = m_subtractive = m_exclusive_or = false; m_additive = m_subtractive = m_exclusive_or = false;
// OSX uses CTRL for context menu, and SHIFT is exclusive-or
#ifdef __WXOSX_MAC__
if( evt->Modifier( MD_SHIFT ) )
m_exclusive_or = true;
#else
if( evt->Modifier( MD_SHIFT ) && evt->Modifier( MD_CTRL ) ) if( evt->Modifier( MD_SHIFT ) && evt->Modifier( MD_CTRL ) )
m_subtractive = true; m_subtractive = true;
else if( evt->Modifier( MD_SHIFT ) ) else if( evt->Modifier( MD_SHIFT ) )
m_additive = true; m_additive = true;
else if( evt->Modifier( MD_CTRL ) ) else if( evt->Modifier( MD_CTRL ) )
m_exclusive_or = true; m_exclusive_or = true;
#endif
// Is the user requesting that the selection list include all possible // Is the user requesting that the selection list include all possible
// items without removing less likely selection candidates // items without removing less likely selection candidates