diff --git a/pcbnew/tools/footprint_editor_tools.cpp b/pcbnew/tools/footprint_editor_tools.cpp index e90a1e8b32..0832fadeec 100644 --- a/pcbnew/tools/footprint_editor_tools.cpp +++ b/pcbnew/tools/footprint_editor_tools.cpp @@ -239,12 +239,24 @@ int MODULE_EDITOR_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent ) break; } - else if( evt->IsCancel() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsActivate() ) + // This is a cancel-current-action (ie: ). + // Note that this must go before IsCancelInteractive() as it also checks IsCancel(). + else if( evt->IsCancel() ) { + // Clear current selection list to avoid selection of deleted items + m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + commit.Revert(); break; } + // Now that cancel-current-action has been handled, check for cancel-tool. + else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) ) + { + commit.Push( _( "Renumber pads" ) ); + break; + } + else { // Delegate BUT_RIGHT, etc. to SELECTION_TOOL