diff --git a/eeschema/dialogs/panel_eeschema_editing_options_base.cpp b/eeschema/dialogs/panel_eeschema_editing_options_base.cpp index 17cbaa1d97..a326b8009c 100644 --- a/eeschema/dialogs/panel_eeschema_editing_options_base.cpp +++ b/eeschema/dialogs/panel_eeschema_editing_options_base.cpp @@ -105,7 +105,7 @@ PANEL_EESCHEMA_EDITING_OPTIONS_BASE::PANEL_EESCHEMA_EDITING_OPTIONS_BASE( wxWind m_staticText101->Wrap( -1 ); fgSizerCmdsWinLin->Add( m_staticText101, 0, wxALL, 5 ); - m_staticText131 = new wxStaticText( m_mouseCmdsWinLin->GetStaticBox(), wxID_ANY, _("Ctrl"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText131 = new wxStaticText( m_mouseCmdsWinLin->GetStaticBox(), wxID_ANY, _("Alt"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText131->Wrap( -1 ); fgSizerCmdsWinLin->Add( m_staticText131, 0, wxALL, 5 ); @@ -113,7 +113,7 @@ PANEL_EESCHEMA_EDITING_OPTIONS_BASE::PANEL_EESCHEMA_EDITING_OPTIONS_BASE( wxWind m_staticText141->Wrap( -1 ); fgSizerCmdsWinLin->Add( m_staticText141, 0, wxALL, 5 ); - m_staticText151 = new wxStaticText( m_mouseCmdsWinLin->GetStaticBox(), wxID_ANY, _("Ctrl+Shift"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText151 = new wxStaticText( m_mouseCmdsWinLin->GetStaticBox(), wxID_ANY, _("Alt+Shift"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText151->Wrap( -1 ); fgSizerCmdsWinLin->Add( m_staticText151, 0, wxALL, 5 ); @@ -121,7 +121,7 @@ PANEL_EESCHEMA_EDITING_OPTIONS_BASE::PANEL_EESCHEMA_EDITING_OPTIONS_BASE( wxWind m_staticText161->Wrap( -1 ); fgSizerCmdsWinLin->Add( m_staticText161, 0, wxALL, 5 ); - m_staticText111 = new wxStaticText( m_mouseCmdsWinLin->GetStaticBox(), wxID_ANY, _("Alt"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText111 = new wxStaticText( m_mouseCmdsWinLin->GetStaticBox(), wxID_ANY, _("Ctrl"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText111->Wrap( -1 ); fgSizerCmdsWinLin->Add( m_staticText111, 0, wxALL, 5 ); diff --git a/eeschema/dialogs/panel_eeschema_editing_options_base.fbp b/eeschema/dialogs/panel_eeschema_editing_options_base.fbp index 6fa9ea1ed6..00d9c56b1d 100644 --- a/eeschema/dialogs/panel_eeschema_editing_options_base.fbp +++ b/eeschema/dialogs/panel_eeschema_editing_options_base.fbp @@ -43,7 +43,7 @@ PANEL_EESCHEMA_EDITING_OPTIONS_BASE - 661,584 + 661,649 ; forward_declare @@ -929,7 +929,7 @@ 0 0 wxID_ANY - Ctrl + Alt 0 0 @@ -1051,7 +1051,7 @@ 0 0 wxID_ANY - Ctrl+Shift + Alt+Shift 0 0 @@ -1173,7 +1173,7 @@ 0 0 wxID_ANY - Alt + Ctrl 0 0 diff --git a/eeschema/dialogs/panel_eeschema_editing_options_base.h b/eeschema/dialogs/panel_eeschema_editing_options_base.h index 9507d4cdea..bf33b43060 100644 --- a/eeschema/dialogs/panel_eeschema_editing_options_base.h +++ b/eeschema/dialogs/panel_eeschema_editing_options_base.h @@ -80,7 +80,7 @@ class PANEL_EESCHEMA_EDITING_OPTIONS_BASE : public wxPanel public: - PANEL_EESCHEMA_EDITING_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 661,584 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + PANEL_EESCHEMA_EDITING_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 661,649 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~PANEL_EESCHEMA_EDITING_OPTIONS_BASE(); }; diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 2e64e42cd3..0f462a898c 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -324,22 +324,73 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) bool displayBusCursor = false; bool displayLineCursor = false; KIID rolloverItem = lastRolloverItem; - m_additive = m_subtractive = m_exclusive_or = false; - if( evt->Modifier( MD_SHIFT ) && evt->Modifier( MD_CTRL ) ) - m_subtractive = true; - else if( evt->Modifier( MD_SHIFT ) ) - m_additive = true; - else if( evt->Modifier( MD_CTRL ) ) - m_exclusive_or = true; + // on left click, a selection is made, depending on modifiers ALT, SHIFT, CTRL: + // Due to the fact ALT key modifier cannot be useed freely on Winows and Linux, + // actions are different on OSX and others OS + // Especially, ALT key cannot be used to force showing the full selection choice + // context menu (the menu is immediately closed on Windows ) + // + // No modifier = select items and deselect previous selection + // ALT (on OSX) = skip heuristic and show full selection choice + // ALT (on others) = exclusive OR of selected items (inverse selection) + // + // CTRL/CMD (on OSX) = exclusive OR of selected items (inverse selection) + // CTRL (on others) = skip heuristic and show full selection choice + // + // SHIFT = add selected items to the current selection + // + // CTRL/CMD+SHIFT (on OSX) = remove selected items to the current selection + // CTRL+SHIFT (on others) = unused (can be used for a new action) + // + // CTRL/CMT+ALT (on OSX) = unused (can be used for a new action) + // CTRL+ALT (on others) = do nothing (same as no modifier) + // + // SHIFT+ALT (on OSX) = do nothing (same as no modifier) + // SHIFT+ALT (on others) = remove selected items to the current selection - bool modifier_enabled = m_subtractive || m_additive || m_exclusive_or; - MOUSE_DRAG_ACTION drag_action = m_frame->GetDragAction(); +#ifdef __WXOSX_MAC__ + m_subtractive = evt->Modifier( MD_CTRL ) && + evt->Modifier( MD_SHIFT ) && + !evt->Modifier( MD_ALT ); + + m_additive = evt->Modifier( MD_SHIFT ) && + !evt->Modifier( MD_CTRL ) && + !evt->Modifier( MD_ALT ); + + m_exclusive_or = evt->Modifier( MD_CTRL ) && + !evt->Modifier( MD_SHIFT ) && + !evt->Modifier( MD_ALT ); + + m_skip_heuristics = evt->Modifier( MD_ALT ) && + !evt->Modifier( MD_SHIFT ) && + !evt->Modifier( MD_CTRL ); + +#else + m_subtractive = evt->Modifier( MD_SHIFT ) + && !evt->Modifier( MD_CTRL ) + && evt->Modifier( MD_ALT ); + + m_additive = evt->Modifier( MD_SHIFT ) + && !evt->Modifier( MD_CTRL ) + && !evt->Modifier( MD_ALT ); + + m_exclusive_or = !evt->Modifier( MD_SHIFT ) + && !evt->Modifier( MD_CTRL ) + && evt->Modifier( MD_ALT ); // Is the user requesting that the selection list include all possible // items without removing less likely selection candidates - m_skip_heuristics = !!evt->Modifier( MD_ALT ); + // Cannot use the Alt key on windows or the disambiguation context menu is immediately + // dismissed rendering it useless. + m_skip_heuristics = evt->Modifier( MD_CTRL ) + && !evt->Modifier( MD_SHIFT ) + && !evt->Modifier( MD_ALT ); +#endif + bool modifier_enabled = m_subtractive || m_additive || m_exclusive_or; + + MOUSE_DRAG_ACTION drag_action = m_frame->GetDragAction(); EE_GRID_HELPER grid( m_toolMgr ); // Single click? Select single object diff --git a/pagelayout_editor/dialogs/properties_frame_base.fbp b/pagelayout_editor/dialogs/properties_frame_base.fbp index 571fef90bb..a1cffe9e11 100644 --- a/pagelayout_editor/dialogs/properties_frame_base.fbp +++ b/pagelayout_editor/dialogs/properties_frame_base.fbp @@ -14,10 +14,9 @@ properties_frame_base 1000 none - 1 - properties_frame + properties_frame_base . @@ -26,7 +25,6 @@ 1 1 UI - 0 1 0 @@ -45,7 +43,7 @@ PANEL_PROPERTIES_BASE - -1,-1 + 309,888 @@ -4016,7 +4014,6 @@ - 0 @@ -4979,7 +4976,6 @@ - 0 @@ -5869,7 +5865,6 @@ - 0 diff --git a/pagelayout_editor/tools/pl_selection_tool.cpp b/pagelayout_editor/tools/pl_selection_tool.cpp index 88766ad79f..c8c8695f3b 100644 --- a/pagelayout_editor/tools/pl_selection_tool.cpp +++ b/pagelayout_editor/tools/pl_selection_tool.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2019 CERN - * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -106,20 +106,70 @@ int PL_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) // Main loop: keep receiving events while( TOOL_EVENT* evt = Wait() ) { - m_additive = m_subtractive = m_exclusive_or = false; + // on left click, a selection is made, depending on modifiers ALT, SHIFT, CTRL: + // Due to the fact ALT key modifier cannot be useed freely on Winows and Linux, + // actions are different on OSX and others OS + // Especially, ALT key cannot be used to force showing the full selection choice + // context menu (the menu is immediately closed on Windows ) + // + // No modifier = select items and deselect previous selection + // ALT (on OSX) = skip heuristic and show full selection choice + // ALT (on others) = exclusive OR of selected items (inverse selection) + // + // CTRL/CMD (on OSX) = exclusive OR of selected items (inverse selection) + // CTRL (on others) = skip heuristic and show full selection choice + // + // SHIFT = add selected items to the current selection + // + // CTRL/CMD+SHIFT (on OSX) = remove selected items to the current selection + // CTRL+SHIFT (on others) = unused (can be used for a new action) + // + // CTRL/CMT+ALT (on OSX) = unused (can be used for a new action) + // CTRL+ALT (on others) = do nothing (same as no modifier) + // + // SHIFT+ALT (on OSX) = do nothing (same as no modifier) + // SHIFT+ALT (on others) = remove selected items to the current selection - if( evt->Modifier( MD_SHIFT ) && evt->Modifier( MD_CTRL ) ) - m_subtractive = true; - else if( evt->Modifier( MD_SHIFT ) ) - m_additive = true; - else if( evt->Modifier( MD_CTRL ) ) - m_exclusive_or = true; +#ifdef __WXOSX_MAC__ + m_subtractive = evt->Modifier( MD_CTRL ) && + evt->Modifier( MD_SHIFT ) && + !evt->Modifier( MD_ALT ); - bool modifier_enabled = m_subtractive || m_additive || m_exclusive_or; + m_additive = evt->Modifier( MD_SHIFT ) && + !evt->Modifier( MD_CTRL ) && + !evt->Modifier( MD_ALT ); + + m_exclusive_or = evt->Modifier( MD_CTRL ) && + !evt->Modifier( MD_SHIFT ) && + !evt->Modifier( MD_ALT ); + + m_skip_heuristics = evt->Modifier( MD_ALT ) && + !evt->Modifier( MD_SHIFT ) && + !evt->Modifier( MD_CTRL ); + +#else + m_subtractive = evt->Modifier( MD_SHIFT ) + && !evt->Modifier( MD_CTRL ) + && evt->Modifier( MD_ALT ); + + m_additive = evt->Modifier( MD_SHIFT ) + && !evt->Modifier( MD_CTRL ) + && !evt->Modifier( MD_ALT ); + + m_exclusive_or = !evt->Modifier( MD_SHIFT ) + && !evt->Modifier( MD_CTRL ) + && evt->Modifier( MD_ALT ); // Is the user requesting that the selection list include all possible // items without removing less likely selection candidates - m_skip_heuristics = !!evt->Modifier( MD_ALT ); + // Cannot use the Alt key on windows or the disambiguation context menu is immediately + // dismissed rendering it useless. + m_skip_heuristics = evt->Modifier( MD_CTRL ) + && !evt->Modifier( MD_SHIFT ) + && !evt->Modifier( MD_ALT ); +#endif + + bool modifier_enabled = m_subtractive || m_additive || m_exclusive_or; // Single click? Select single object if( evt->IsClick( BUT_LEFT ) )