From 535ea800c0c983f59fcc078a9abe75828aa3a79b Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 25 Feb 2022 16:14:41 -0800 Subject: [PATCH] Honor modifier keys in diambiguation Needs to be reset for the new action before selecting elements at a point. Fixes https://gitlab.com/kicad/code/kicad/issues/9712 (cherry picked from commit a30ad0b54a7f0b3a174c3994f6e9ffb6e35dae75) --- eeschema/tools/ee_selection_tool.cpp | 5 +++++ pagelayout_editor/tools/pl_selection_tool.cpp | 5 +++++ pcbnew/tools/pcb_selection_tool.cpp | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 228e478dc6..9f507a07a8 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -723,6 +723,11 @@ OPT_TOOL_EVENT EE_SELECTION_TOOL::autostartEvent( TOOL_EVENT* aEvent, EE_GRID_HE int EE_SELECTION_TOOL::disambiguateCursor( const TOOL_EVENT& aEvent ) { + wxMouseState keyboardState = wxGetMouseState(); + + setModifiersState( keyboardState.ShiftDown(), keyboardState.ControlDown(), + keyboardState.AltDown() ); + m_skip_heuristics = true; SelectPoint( m_originalCursor, EE_COLLECTOR::AllItems, nullptr, &m_canceledMenu, false, m_additive, m_subtractive, m_exclusive_or ); diff --git a/pagelayout_editor/tools/pl_selection_tool.cpp b/pagelayout_editor/tools/pl_selection_tool.cpp index ce2a61e1a2..f12db6454f 100644 --- a/pagelayout_editor/tools/pl_selection_tool.cpp +++ b/pagelayout_editor/tools/pl_selection_tool.cpp @@ -235,6 +235,11 @@ int PL_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) int PL_SELECTION_TOOL::disambiguateCursor( const TOOL_EVENT& aEvent ) { + wxMouseState keyboardState = wxGetMouseState(); + + setModifiersState( keyboardState.ShiftDown(), keyboardState.ControlDown(), + keyboardState.AltDown() ); + m_skip_heuristics = true; SelectPoint( m_originalCursor, &m_canceledMenu ); m_skip_heuristics = false; diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 9b489222a2..8e8b880c1e 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -926,6 +926,11 @@ bool PCB_SELECTION_TOOL::selectMultiple() int PCB_SELECTION_TOOL::disambiguateCursor( const TOOL_EVENT& aEvent ) { + wxMouseState keyboardState = wxGetMouseState(); + + setModifiersState( keyboardState.ShiftDown(), keyboardState.ControlDown(), + keyboardState.AltDown() ); + m_skip_heuristics = true; selectPoint( m_originalCursor, false, &m_canceledMenu ); m_skip_heuristics = false;