eeschema: implement left click emulation with Enter/Return key in library editor

Fixes: lp:1788075
* https://bugs.launchpad.net/kicad/+bug/1788075
This commit is contained in:
Tomasz Włostowski 2019-01-28 14:17:51 +01:00
parent 4a0fba309a
commit ef2af9145e
1 changed files with 17 additions and 9 deletions

View File

@ -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.