← Back to team overview

kicad-developers team mailing list archive

eeschema hotkey shortcut for add label -- patch

 

Hi again,

This patch add hotkey shortcut for "Add Label" action in eeschema. Why
shortcut char is 'T'? I think this is common shortcut for adding text in
graphical editors, and 'T' button very near to other shortcuts -- 'A',
'W', 'E', 'R', etc.

Regards,
  Yury

=== modified file 'eeschema/hotkeys.cpp'
--- eeschema/hotkeys.cpp        2010-03-24 18:26:04 +0000
+++ eeschema/hotkeys.cpp        2010-07-19 06:39:44 +0000
@@ -103,6 +103,7 @@

 // Schematic editor
 static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE,
'W' );
+static Ki_HotkeyInfo HkAddLabel( wxT( "Add Label" ), HK_ADD_NEW_LABEL,
'T' );
 static Ki_HotkeyInfo HkAddComponent( wxT( "Add Component" ),
                                      HK_ADD_NEW_COMPONENT, 'A' );
 static Ki_HotkeyInfo HkMirrorYComponent( wxT( "Mirror Y Component" ),
@@ -144,6 +145,7 @@
 static Ki_HotkeyInfo HkFindNextDrcMarker( wxT( "Find next DRC marker"
), HK_FIND_NEXT_DRC_MARKER,
                                           WXK_F5 + GR_KB_SHIFT );

 // Special keys for library editor:
 static Ki_HotkeyInfo HkInsertPin( wxT( "Repeat Pin" ), HK_REPEAT_LAST,
                                   WXK_INSERT );
@@ -188,6 +190,7 @@
     &HkEditComponentValue,
     &HkEditComponentFootprint,
     &HkBeginWire,
+   &HkAddLabel,
     NULL
 };

@@ -383,6 +386,16 @@
         }
         break;

+    case HK_ADD_NEW_LABEL:      // Add Label
+        if( !ItemInEdit )
+        {
+            if( m_ID_current_state != ID_LABEL_BUTT )
+                SetToolID( ID_LABEL_BUTT, wxCURSOR_PENCIL,
+                          _( "Add Label" ) );
+            OnLeftClick( DC, MousePos );
+        }
+        break;
+

=== modified file 'eeschema/hotkeys.h'
--- eeschema/hotkeys.h  2010-03-16 18:22:59 +0000
+++ eeschema/hotkeys.h  2010-07-08 12:00:06 +0000
@@ -31,6 +31,7 @@
     HK_COPY_COMPONENT_OR_LABEL,
     HK_DRAG,
     HK_ADD_NEW_COMPONENT,
+   HK_ADD_NEW_LABEL,
     HK_BEGIN_WIRE
 };
-- 
This message was sent from Launchpad by the user
Yury Khalyavin (https://launchpad.net/~snufrick)
using the "Contact this team" link on the KiCad Developers team page.
For more information see
https://help.launchpad.net/YourAccount/ContactingPeople



Follow ups