diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 52951a280f..0d716cc9f3 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -102,6 +102,7 @@ static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, #endif // Schematic editor +static Ki_HotkeyInfo HkAddLabel( wxT( "add Label" ), HK_ADD_LABEL, 'L' ); static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE, 'W' ); static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ), HK_ADD_NEW_COMPONENT, 'A' ); @@ -188,6 +189,7 @@ Ki_HotkeyInfo* s_Schematic_Hotkey_List[] = &HkEditComponentValue, &HkEditComponentFootprint, &HkBeginWire, + &HkAddLabel, NULL }; @@ -383,6 +385,13 @@ void WinEDA_SchematicFrame::OnHotKey( wxDC* DC, int hotkey, } break; + case HK_ADD_LABEL: + // switch to m_ID_current_state = ID_LABEL_BUTT; + if( m_ID_current_state != ID_LABEL_BUTT ) + SetToolID( ID_LABEL_BUTT, wxCURSOR_PENCIL, _( "Add Label" ) ); + OnLeftClick( DC, MousePos ); + break; + case HK_BEGIN_WIRE: /* An item is selected. If edited and not a wire, a new command is not diff --git a/eeschema/hotkeys.h b/eeschema/hotkeys.h index 1995b52175..f2eb531b01 100644 --- a/eeschema/hotkeys.h +++ b/eeschema/hotkeys.h @@ -31,7 +31,8 @@ enum hotkey_id_commnand { HK_COPY_COMPONENT_OR_LABEL, HK_DRAG, HK_ADD_NEW_COMPONENT, - HK_BEGIN_WIRE + HK_BEGIN_WIRE, + HK_ADD_LABEL }; // List of hotkey descriptors for eeschema