diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 032a461f56..f09278d9c5 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -714,15 +714,6 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, GetScreen()->m_O_Curseur = GetCrossHairPosition(); break; - case HK_LEFT_CLICK: - OnLeftClick( aDC, aPosition ); - break; - - case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events - OnLeftClick( aDC, aPosition ); - OnLeftDClick( aDC, aPosition ); - break; - case HK_ZOOM_IN: case HK_ZOOM_OUT: case HK_ZOOM_REDRAW: @@ -871,6 +862,23 @@ bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, OnOrient( cmd ); } break; + + case HK_LEFT_CLICK: + case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events + if( GetScreen()->m_BlockLocate.GetState() == STATE_BLOCK_MOVE ) + { + GetCanvas()->SetAutoPanRequest( false ); + HandleBlockPlace( aDC ); + } + else if( GetScreen()->m_BlockLocate.GetState() == STATE_NO_BLOCK ) + { + auto pos = GetCrossHairPosition(); + OnLeftClick( aDC, pos ); + + if( hotKey->m_Idcommand == HK_LEFT_DCLICK ) + OnLeftDClick( aDC, pos ); + } + break; } // Hot key handled.