← Back to team overview

kicad-developers team mailing list archive

Add hotkey shortcut 'P' for "Create Pin" action in LibEdit

 

Hi again,

Patch add hotkey shortcut 'P' for "Create Pin" action in
LibEdit, I think it usefull for people who like work with
keyboard shortcut. If anyone not like 'P' key, he can redefine it
by editing hotkeys file.

Regards,
--
    Yury Khalyavin
=== modified file eeschema/hotkeys.cpp
--- eeschema/hotkeys.cpp	2010-07-20 11:38:47 +0000
+++ eeschema/hotkeys.cpp	2010-07-20 11:47:31 +0000
@@ -148,6 +148,8 @@
                                           WXK_F5 + GR_KB_SHIFT );
 
 // Special keys for library editor:
+static Ki_HotkeyInfo HkCreatePin( wxT( "Create Pin" ),
+                                  HK_LIBEDIT_CREATE_PIN, 'P' );
 static Ki_HotkeyInfo HkInsertPin( wxT( "Repeat Pin" ), HK_REPEAT_LAST,
                                   WXK_INSERT );
 static Ki_HotkeyInfo HkMovePin( wxT( "Move Pin" ), HK_LIBEDIT_MOVE_GRAPHIC_ITEM, 'M' );
@@ -199,6 +201,7 @@
 // List of hotkey descriptors for library editor
 Ki_HotkeyInfo* s_LibEdit_Hotkey_List[] =
 {
+    &HkCreatePin,
     &HkInsertPin,
     &HkEdit,
     &HkMovePin,
@@ -844,6 +847,13 @@
         }
         break;
 
+    case HK_LIBEDIT_CREATE_PIN:
+        {
+            wxCommandEvent evt;
+            evt.SetId( ID_LIBEDIT_PIN_BUTT );
+            Process_Special_Functions( evt );
+            break;
+        }
 
     case HK_DELETE_PIN:
         m_drawItem = LocateItemUsingCursor();

=== modified file eeschema/hotkeys.h
--- eeschema/hotkeys.h	2010-07-20 11:38:47 +0000
+++ eeschema/hotkeys.h	2010-07-20 11:47:31 +0000
@@ -18,7 +18,8 @@
 	HK_EDIT_PIN,
 	HK_LIBEDIT_MOVE_GRAPHIC_ITEM,
 	HK_LIBEDIT_ROTATE_PIN,
- 	HK_DELETE_PIN,
+	HK_LIBEDIT_CREATE_PIN,
+    HK_DELETE_PIN,
     HK_MOVEBLOCK_TO_DRAGBLOCK,
     HK_ROTATE,
 	HK_EDIT,

Follow ups