diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 9d36c41b60..c11bac377e 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -323,7 +323,8 @@ int EDIT_TOOL::Move( const TOOL_EVENT& aEvent ) grid.SetUseGrid( !evt->Modifier( MD_ALT ) ); controls->SetSnapping( !evt->Modifier( MD_ALT ) ); - if( evt->IsAction( &PCB_ACTIONS::move ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT ) || + if( evt->IsAction( &PCB_ACTIONS::move ) || evt->IsMotion() || + evt->IsAction( &PCB_ACTIONS::drag ) || evt->IsDrag( BUT_LEFT ) || evt->IsAction( &ACTIONS::refreshPreview ) ) { if( m_dragging && evt->Category() == TC_MOUSE ) @@ -1413,6 +1414,7 @@ void EDIT_TOOL::setTransitions() { Go( &EDIT_TOOL::GetAndPlace, PCB_ACTIONS::getAndPlace.MakeEvent() ); Go( &EDIT_TOOL::Move, PCB_ACTIONS::move.MakeEvent() ); + Go( &EDIT_TOOL::Move, PCB_ACTIONS::drag.MakeEvent() ); Go( &EDIT_TOOL::Drag, PCB_ACTIONS::drag45Degree.MakeEvent() ); Go( &EDIT_TOOL::Drag, PCB_ACTIONS::dragFreeAngle.MakeEvent() ); Go( &EDIT_TOOL::Rotate, PCB_ACTIONS::rotateCw.MakeEvent() ); diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 7e26276cdd..4b56646b79 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -192,6 +192,10 @@ TOOL_ACTION PCB_ACTIONS::move( "pcbnew.InteractiveMove.move", _( "Move" ), _( "Moves the selected item(s)" ), move_xpm, AF_ACTIVATE ); +TOOL_ACTION PCB_ACTIONS::drag( "pcbnew.InteractiveMove.drag", + AS_GLOBAL, 0, "", "", "", + move_xpm, AF_ACTIVATE ); + TOOL_ACTION PCB_ACTIONS::duplicateIncrement( "pcbnew.InteractiveEdit.duplicateIncrementPads", AS_GLOBAL, MD_SHIFT + MD_CTRL + 'D', LEGACY_HK_NAME( "Duplicate Item and Increment" ), diff --git a/pcbnew/tools/pcb_actions.h b/pcbnew/tools/pcb_actions.h index 38bb8c4a78..e09a5734bd 100644 --- a/pcbnew/tools/pcb_actions.h +++ b/pcbnew/tools/pcb_actions.h @@ -104,8 +104,9 @@ public: /// Filters the items in the current selection (invokes dialog) static TOOL_ACTION filterSelection; - /// move an item + /// move or drag an item static TOOL_ACTION move; + static TOOL_ACTION drag; /// Rotation of selected objects static TOOL_ACTION rotateCw; diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index bc25ec6bf2..3b45a92371 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -251,7 +251,7 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( selectionContains( evt->Position() ) ) { // Yes -> run the move tool and wait till it finishes - m_toolMgr->RunAction( PCB_ACTIONS::move, true ); + m_toolMgr->RunAction( PCB_ACTIONS::drag, true ); } else {