KiCad PCB EDA Suite
pcbnew/hotkeys.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
29 #include <fctsys.h>
30 #include <pcbnew.h>
31 #include <wxPcbStruct.h>
32 #include <modview_frame.h>
33 #include <pcbnew_id.h>
34 
35 #include <hotkeys.h>
36 
37 // Remark: the hotkey message info is used as keyword in hotkey config files and
38 // as comments in help windows, therefore translated only when displayed
39 // they are marked _HKI to be extracted by translation tools
40 // See hotkeys_basic.h for more info
41 
42 
43 /* How to add a new hotkey:
44  * add a new id in the enum hotkey_id_commnand like MY_NEW_ID_FUNCTION.
45  * add a new EDA_HOTKEY entry like:
46  * static EDA_HOTKEY HkMyNewEntry(_HKI("Command Label"), MY_NEW_ID_FUNCTION, default key value);
47  * "Command Label" is the name used in hotkey list display, and the identifier in the
48  * hotkey list file MY_NEW_ID_FUNCTION is an equivalent id function used in the switch
49  * in OnHotKey() function.
50  * default key value is the default hotkey for this command. Can be overridden by the user
51  * hotkey list file
52  * add the HkMyNewEntry pointer in the s_board_edit_Hotkey_List list ( or/and the
53  * s_module_edit_Hotkey_List list)
54  * Add the new code in the switch in OnHotKey() function.
55  * Note: when the variable itemCurrentlyEdited is true, an item is currently edited.
56  * This can be useful if the new function cannot be executed while an item is currently
57  * being edited ( For example, one cannot start a new wire when a component is moving.)
58  *
59  * Note: If a hotkey is a special key, be sure the corresponding wxWidget keycode (WXK_XXXX)
60  * is handled in the hotkey_name_descr s_Hotkey_Name_List list (see hotkeys_basic.cpp)
61  * and see this list for some ascii keys (space ...)
62  */
63 
64 // Hotkey list:
65 
66 // mouse click command:
67 static EDA_HOTKEY HkMouseLeftClick( _HKI( "Mouse Left Click" ),
68  HK_LEFT_CLICK, WXK_RETURN, 0 );
69 static EDA_HOTKEY HkMouseLeftDClick( _HKI( "Mouse Left Double Click" ),
70  HK_LEFT_DCLICK, WXK_END, 0 );
71 
72 static EDA_HOTKEY HkSwitch2CopperLayer( _HKI( "Switch to Copper (B.Cu) layer" ),
73  HK_SWITCH_LAYER_TO_COPPER, WXK_PAGEDOWN );
74 
75 static EDA_HOTKEY HkSwitch2ComponentLayer( _HKI( "Switch to Component (F.Cu) layer" ),
76  HK_SWITCH_LAYER_TO_COMPONENT, WXK_PAGEUP );
77 
78 static EDA_HOTKEY HkSwitch2InnerLayer1( _HKI( "Switch to Inner layer 1" ),
79  HK_SWITCH_LAYER_TO_INNER1, WXK_F5 );
80 static EDA_HOTKEY HkSwitch2InnerLayer2( _HKI( "Switch to Inner layer 2" ),
81  HK_SWITCH_LAYER_TO_INNER2, WXK_F6 );
82 static EDA_HOTKEY HkSwitch2InnerLayer3( _HKI( "Switch to Inner layer 3" ),
83  HK_SWITCH_LAYER_TO_INNER3, WXK_F7 );
84 static EDA_HOTKEY HkSwitch2InnerLayer4( _HKI( "Switch to Inner layer 4" ),
85  HK_SWITCH_LAYER_TO_INNER4, WXK_F8 );
86 static EDA_HOTKEY HkSwitch2InnerLayer5( _HKI( "Switch to Inner layer 5" ),
88 static EDA_HOTKEY HkSwitch2InnerLayer6( _HKI( "Switch to Inner layer 6" ),
90 
91 static EDA_HOTKEY HkSwitch2NextCopperLayer( _HKI( "Switch to Next Layer" ),
93 static EDA_HOTKEY HkSwitch2PreviousCopperLayer( _HKI( "Switch to Previous Layer" ),
95 
96 static EDA_HOTKEY HkSaveModule( _HKI( "Save Footprint" ), HK_SAVE_MODULE, 'S' + GR_KB_CTRL );
97 static EDA_HOTKEY HkSavefile( _HKI( "Save Board" ), HK_SAVE_BOARD, 'S' + GR_KB_CTRL );
98 static EDA_HOTKEY HkSavefileAs( _HKI( "Save Board As" ), HK_SAVE_BOARD_AS, 'S' + GR_KB_CTRL + GR_KB_SHIFT );
99 static EDA_HOTKEY HkLoadfile( _HKI( "Load Board" ), HK_LOAD_BOARD, 'L' + GR_KB_CTRL );
100 static EDA_HOTKEY HkFindItem( _HKI( "Find Item" ), HK_FIND_ITEM, 'F' + GR_KB_CTRL );
101 static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTION, '@', ID_ZOOM_SELECTION );
102 static EDA_HOTKEY HkBackspace( _HKI( "Delete Track Segment" ), HK_BACK_SPACE, WXK_BACK );
103 static EDA_HOTKEY HkAddNewTrack( _HKI( "Add New Track" ), HK_ADD_NEW_TRACK, 'X' );
104 static EDA_HOTKEY HkAddThroughVia( _HKI( "Add Through Via" ), HK_ADD_THROUGH_VIA, 'V' );
105 static EDA_HOTKEY HkSelLayerAndAddThroughVia( _HKI( "Select Layer and Add Through Via" ),
107 static EDA_HOTKEY HkAddMicroVia( _HKI( "Add MicroVia" ), HK_ADD_MICROVIA, 'V' + GR_KB_CTRL );
108 static EDA_HOTKEY HkAddBlindBuriedVia( _HKI( "Add Blind/Buried Via" ), HK_ADD_BLIND_BURIED_VIA, 'V' + GR_KB_ALT + GR_KB_SHIFT );
109 static EDA_HOTKEY HkSelLayerAndAddBlindBuriedVia( _HKI( "Select Layer and Add Blind/Buried Via" ),
111 static EDA_HOTKEY HkSwitchTrackPosture( _HKI( "Switch Track Posture" ), HK_SWITCH_TRACK_POSTURE, '/' );
112 static EDA_HOTKEY HkDragTrackKeepSlope( _HKI( "Drag Track Keep Slope" ), HK_DRAG_TRACK_KEEP_SLOPE, 'D' );
113 static EDA_HOTKEY HkPlaceItem( _HKI( "Place Item" ), HK_PLACE_ITEM, 'P' );
114 static EDA_HOTKEY HkEditBoardItem( _HKI( "Edit Item" ), HK_EDIT_ITEM, 'E' );
115 static EDA_HOTKEY HkEditWithModedit( _HKI( "Edit with Footprint Editor" ), HK_EDIT_MODULE_WITH_MODEDIT, 'E' + GR_KB_CTRL );
116 static EDA_HOTKEY HkFlipItem( _HKI( "Flip Item" ), HK_FLIP_ITEM, 'F' );
117 static EDA_HOTKEY HkRotateItem( _HKI( "Rotate Item" ), HK_ROTATE_ITEM, 'R' );
118 static EDA_HOTKEY HkMoveItem( _HKI( "Move Item" ), HK_MOVE_ITEM, 'M' );
119 static EDA_HOTKEY HkMoveItemExact( _HKI( "Move Item Exactly" ), HK_MOVE_ITEM_EXACT, 'M' + GR_KB_CTRL );
120 static EDA_HOTKEY HkDuplicateItem( _HKI( "Duplicate Item" ), HK_DUPLICATE_ITEM, 'D' + GR_KB_CTRL );
121 static EDA_HOTKEY HkDuplicateItemAndIncrement( _HKI( "Duplicate Item and Increment" ),
123 static EDA_HOTKEY HkCreateArray( _HKI( "Create Array" ), HK_CREATE_ARRAY, 'N' + GR_KB_CTRL );
124 static EDA_HOTKEY HkCopyItem( _HKI( "Copy Item" ), HK_COPY_ITEM, 'C' );
125 static EDA_HOTKEY HkDragFootprint( _HKI( "Drag Item" ), HK_DRAG_ITEM, 'G' );
126 static EDA_HOTKEY HkGetAndMoveFootprint( _HKI( "Get and Move Footprint" ), HK_GET_AND_MOVE_FOOTPRINT, 'T' );
127 static EDA_HOTKEY HkLock_Unlock_Footprint( _HKI( "Lock/Unlock Footprint" ), HK_LOCK_UNLOCK_FOOTPRINT, 'L' );
128 static EDA_HOTKEY HkDelete( _HKI( "Delete Track or Footprint" ), HK_DELETE, WXK_DELETE );
129 static EDA_HOTKEY HkResetLocalCoord( _HKI( "Reset Local Coordinates" ), HK_RESET_LOCAL_COORD, ' ' );
130 static EDA_HOTKEY HkSwitchHighContrastMode( _HKI( "Toggle High Contrast Mode" ), HK_SWITCH_HIGHCONTRAST_MODE,'H');
131 
132 static EDA_HOTKEY HkSetGridOrigin( _HKI( "Set Grid Origin" ), HK_SET_GRID_ORIGIN, 'S' );
133 static EDA_HOTKEY HkResetGridOrigin( _HKI( "Reset Grid Origin" ), HK_RESET_GRID_ORIGIN, 'Z' );
134 
135 static EDA_HOTKEY HkCanvasDefault( _HKI( "Switch to Legacy Canvas" ),
137 #ifdef __WXMAC__
138  GR_KB_ALT +
139 #endif
140  WXK_F9 );
141 static EDA_HOTKEY HkCanvasOpenGL( _HKI( "Switch to OpenGL Canvas" ),
143 #ifdef __WXMAC__
144  GR_KB_ALT +
145 #endif
146  WXK_F11 );
147 static EDA_HOTKEY HkCanvasCairo( _HKI( "Switch to Cairo Canvas" ),
149 #ifdef __WXMAC__
150  GR_KB_ALT +
151 #endif
152  WXK_F12 );
153 
154 static EDA_HOTKEY HkZoneFillOrRefill( _HKI( "Fill or Refill All Zones" ),
155  HK_ZONE_FILL_OR_REFILL, 'B' );
156 static EDA_HOTKEY HkZoneRemoveFilled( _HKI( "Remove Filled Areas in All Zones" ),
158 /* Fit on Screen */
159 #if !defined( __WXMAC__ )
160 static EDA_HOTKEY HkZoomAuto( _HKI( "Zoom Auto" ), HK_ZOOM_AUTO, WXK_HOME );
161 #else
162 static EDA_HOTKEY HkZoomAuto( _HKI( "Zoom Auto" ), HK_ZOOM_AUTO, GR_KB_CTRL + '0' );
163 #endif
164 
165 static EDA_HOTKEY HkZoomCenter( _HKI( "Zoom Center" ), HK_ZOOM_CENTER, WXK_F4 );
166 
167 /* Refresh Screen */
168 #if !defined( __WXMAC__ )
169 static EDA_HOTKEY HkZoomRedraw( _HKI( "Zoom Redraw" ), HK_ZOOM_REDRAW, WXK_F3 );
170 #else
171 static EDA_HOTKEY HkZoomRedraw( _HKI( "Zoom Redraw" ), HK_ZOOM_REDRAW, GR_KB_CTRL + 'R' );
172 #endif
173 
174 /* Zoom In */
175 #if !defined( __WXMAC__ )
176 static EDA_HOTKEY HkZoomIn( _HKI( "Zoom In" ), HK_ZOOM_IN, WXK_F1 );
177 #else
178 static EDA_HOTKEY HkZoomIn( _HKI( "Zoom In" ), HK_ZOOM_IN, GR_KB_CTRL + '+' );
179 #endif
180 
181 /* Zoom Out */
182 #if !defined( __WXMAC__ )
183 static EDA_HOTKEY HkZoomOut( _HKI( "Zoom Out" ), HK_ZOOM_OUT, WXK_F2 );
184 #else
185 static EDA_HOTKEY HkZoomOut( _HKI( "Zoom Out" ), HK_ZOOM_OUT, GR_KB_CTRL + '-' );
186 #endif
187 
188 static EDA_HOTKEY Hk3DViewer( _HKI( "3D Viewer" ), HK_3D_VIEWER, GR_KB_ALT + '3' );
189 
190 static EDA_HOTKEY HkHelp( _HKI( "Help (this window)" ), HK_HELP, '?' );
191 
192 
193 /* Undo */
194 static EDA_HOTKEY HkUndo( _HKI( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z', (int) wxID_UNDO );
195 
196 /* Redo */
197 #if !defined( __WXMAC__ )
198 static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y', (int) wxID_REDO );
199 #else
200 static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO,
201  GR_KB_SHIFT + GR_KB_CTRL + 'Z',
202  (int) wxID_REDO );
203 #endif
204 
205 static EDA_HOTKEY HkSwitchTrackWidthToNext( _HKI( "Switch Track Width To Next" ),
207 
208 static EDA_HOTKEY HkSwitchTrackWidthToPrevious( _HKI( "Switch Track Width To Previous" ),
210  + GR_KB_CTRL );
211 
212 static EDA_HOTKEY HkSwitchGridToFastGrid1( _HKI( "Switch Grid To Fast Grid1" ),
214 
215 static EDA_HOTKEY HkSwitchGridToFastGrid2( _HKI( "Switch Grid To Fast Grid2" ),
217 
218 static EDA_HOTKEY HkSwitchGridToNext( _HKI( "Switch Grid To Next" ),
219  HK_SWITCH_GRID_TO_NEXT, 'N' );
220 
221 static EDA_HOTKEY HkSwitchGridToPrevious( _HKI( "Switch Grid To Previous" ),
223 
224 static EDA_HOTKEY HkSwitchUnits( _HKI( "Switch Units" ), HK_SWITCH_UNITS, 'U' + GR_KB_CTRL );
225 static EDA_HOTKEY HkTrackDisplayMode( _HKI( "Track Display Mode" ),
227 static EDA_HOTKEY HkAddModule( _HKI( "Add Footprint" ), HK_ADD_MODULE, 'O' );
228 
229 // List of common hotkey descriptors
231 {
235  &HkUndo, &HkRedo,
238  NULL
239 };
240 
241 // common hotkey descriptors only useful in footprint viewer
243 {
249  NULL
250 };
251 
252 // List of hotkey descriptors for Pcbnew
254 {
256  &HkBackspace,
258  &HkAddMicroVia,
263  &HkMoveItem,
264  &HkFlipItem,
280  NULL
281 };
282 
283 // List of hotkey descriptors for the module editor
289  NULL
290  };
291 
292 // List of hotkey descriptors for the module viewer
293 // Currently empty
295  NULL
296  };
297 
298 // Keyword Identifiers (tags) in key code configuration file (section names)
299 // (.m_SectionTag member of a EDA_HOTKEY_CONFIG)
300 static wxString boardEditorSectionTag( wxT( "[pcbnew]" ) );
301 static wxString moduleEditSectionTag( wxT( "[footprinteditor]" ) );
302 
303 // Titles for hotkey editor and hotkey display
304 static wxString commonSectionTitle( _HKI( "Common" ) );
305 static wxString boardEditorSectionTitle( _HKI( "Board Editor" ) );
306 static wxString moduleEditSectionTitle( _HKI( "Footprint Editor" ) );
307 
308 // list of sections and corresponding hotkey list for Pcbnew
309 // (used to create an hotkey config file, and edit hotkeys )
314  { NULL, NULL, NULL }
315 };
316 
317 // list of sections and corresponding hotkey list for the board editor
318 // (used to list current hotkeys in the board editor)
322  { NULL, NULL, NULL }
323 };
324 
325 // list of sections and corresponding hotkey list for the footprint editor
326 // (used to list current hotkeys in the module editor)
330  { NULL, NULL, NULL }
331 };
332 
333 // list of sections and corresponding hotkey list for the footprint viewer
334 // (used to list current hotkeys in the module viewer)
337  { NULL, NULL, NULL }
338 };
339 
340 
342 {
343  EDA_HOTKEY* HK_Descr = GetDescriptorFromCommand( aCommand, common_Hotkey_List );
344 
345  if( HK_Descr == NULL )
346  HK_Descr = GetDescriptorFromCommand( aCommand, module_viewer_Hotkey_List );
347 
348  return HK_Descr;
349 }
350 
351 
352 bool FOOTPRINT_VIEWER_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
353  EDA_ITEM* aItem )
354 {
355  if( aHotKey == 0 )
356  return false;
357 
358  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
359  cmd.SetEventObject( this );
360 
361  /* Convert lower to upper case (the usual toupper function has problem with non ascii
362  * codes like function keys */
363  if( (aHotKey >= 'a') && (aHotKey <= 'z') )
364  aHotKey += 'A' - 'a';
365 
366  EDA_HOTKEY* HK_Descr = GetDescriptorFromHotkey( aHotKey, common_Hotkey_List );
367 
368  if( HK_Descr == NULL )
369  HK_Descr = GetDescriptorFromHotkey( aHotKey, module_viewer_Hotkey_List );
370 
371  if( HK_Descr == NULL )
372  return false;
373 
374  switch( HK_Descr->m_Idcommand )
375  {
376  default:
377  case HK_NOT_FOUND:
378  return false;
379 
380  case HK_HELP: // Display Current hotkey list
381  DisplayHotkeyList( this, g_Module_Viewer_Hokeys_Descr );
382  break;
383 
384  case HK_RESET_LOCAL_COORD: // set local (relative) coordinate origin
386  break;
387 
388  case HK_LEFT_CLICK:
389  OnLeftClick( aDC, aPosition );
390  break;
391 
392  case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events
393  OnLeftClick( aDC, aPosition );
394  OnLeftDClick( aDC, aPosition );
395  break;
396 
397  case HK_SWITCH_UNITS:
398  cmd.SetId( (g_UserUnit == INCHES) ?
400  GetEventHandler()->ProcessEvent( cmd );
401  break;
402 
403  case HK_ZOOM_IN:
404  cmd.SetId( ID_POPUP_ZOOM_IN );
405  GetEventHandler()->ProcessEvent( cmd );
406  break;
407 
408  case HK_ZOOM_OUT:
409  cmd.SetId( ID_POPUP_ZOOM_OUT );
410  GetEventHandler()->ProcessEvent( cmd );
411  break;
412 
413  case HK_ZOOM_REDRAW:
414  cmd.SetId( ID_ZOOM_REDRAW );
415  GetEventHandler()->ProcessEvent( cmd );
416  break;
417 
418  case HK_ZOOM_CENTER:
419  cmd.SetId( ID_POPUP_ZOOM_CENTER );
420  GetEventHandler()->ProcessEvent( cmd );
421  break;
422 
423  case HK_ZOOM_AUTO:
424  cmd.SetId( ID_ZOOM_PAGE );
425  GetEventHandler()->ProcessEvent( cmd );
426  break;
427  }
428 
429  return true;
430 }
static EDA_HOTKEY HkMouseLeftClick(_HKI("Mouse Left Click"), HK_LEFT_CLICK, WXK_RETURN, 0)
static wxString boardEditorSectionTitle(_HKI("Board Editor"))
static EDA_HOTKEY HkSwitchHighContrastMode(_HKI("Toggle High Contrast Mode"), HK_SWITCH_HIGHCONTRAST_MODE,'H')
Structure EDA_HOTKEY_CONFIG contains the information required to save hot key information to a config...
Definition: hotkeys_basic.h:87
static EDA_HOTKEY HkDragTrackKeepSlope(_HKI("Drag Track Keep Slope"), HK_DRAG_TRACK_KEEP_SLOPE, 'D')
bool OnHotKey(wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
Function OnHotKey handle hot key events.
static EDA_HOTKEY HkCopyItem(_HKI("Copy Item"), HK_COPY_ITEM, 'C')
static EDA_HOTKEY HkZoomIn(_HKI("Zoom In"), HK_ZOOM_IN, WXK_F1)
static EDA_HOTKEY HkDelete(_HKI("Delete Track or Footprint"), HK_DELETE, WXK_DELETE)
static EDA_HOTKEY HkSwitch2ComponentLayer(_HKI("Switch to Component (F.Cu) layer"), HK_SWITCH_LAYER_TO_COMPONENT, WXK_PAGEUP)
static EDA_HOTKEY HkAddMicroVia(_HKI("Add MicroVia"), HK_ADD_MICROVIA, 'V'+GR_KB_CTRL)
static EDA_HOTKEY HkGetAndMoveFootprint(_HKI("Get and Move Footprint"), HK_GET_AND_MOVE_FOOTPRINT, 'T')
static EDA_HOTKEY HkSwitch2PreviousCopperLayer(_HKI("Switch to Previous Layer"), HK_SWITCH_LAYER_TO_PREVIOUS, '-')
static EDA_HOTKEY HkDuplicateItemAndIncrement(_HKI("Duplicate Item and Increment"), HK_DUPLICATE_ITEM_AND_INCREMENT, 'D'+GR_KB_SHIFTCTRL)
static EDA_HOTKEY HkCanvasDefault(_HKI("Switch to Legacy Canvas"), HK_CANVAS_LEGACY, WXK_F9)
static EDA_HOTKEY HkSwitch2InnerLayer4(_HKI("Switch to Inner layer 4"), HK_SWITCH_LAYER_TO_INNER4, WXK_F8)
static EDA_HOTKEY HkZoomCenter(_HKI("Zoom Center"), HK_ZOOM_CENTER, WXK_F4)
static EDA_HOTKEY HkRotateItem(_HKI("Rotate Item"), HK_ROTATE_ITEM, 'R')
static EDA_HOTKEY HkAddBlindBuriedVia(_HKI("Add Blind/Buried Via"), HK_ADD_BLIND_BURIED_VIA, 'V'+GR_KB_ALT+GR_KB_SHIFT)
static EDA_HOTKEY HkSwitchGridToNext(_HKI("Switch Grid To Next"), HK_SWITCH_GRID_TO_NEXT, 'N')
static wxString moduleEditSectionTitle(_HKI("Footprint Editor"))
wxPoint m_O_Curseur
Relative Screen cursor coordinate (on grid) in user units.
#define GR_KB_ALT
Definition: common.h:65
static EDA_HOTKEY HkZoomOut(_HKI("Zoom Out"), HK_ZOOM_OUT, WXK_F2)
Pcbnew hotkeys.
EDA_DRAW_FRAME::OnSelectGrid ID_TB_OPTIONS_SELECT_UNIT_INCH
Definition: draw_frame.cpp:121
EDA_HOTKEY * GetDescriptorFromHotkey(int aKey, EDA_HOTKEY **aList)
Function GetDescriptorFromHotkey Return a EDA_HOTKEY * pointer from a key code for OnHotKey() functio...
struct EDA_HOTKEY_CONFIG g_Board_Editor_Hokeys_Descr[]
static EDA_HOTKEY HkSaveModule(_HKI("Save Footprint"), HK_SAVE_MODULE, 'S'+GR_KB_CTRL)
static EDA_HOTKEY HkFlipItem(_HKI("Flip Item"), HK_FLIP_ITEM, 'F')
static EDA_HOTKEY HkSelLayerAndAddBlindBuriedVia(_HKI("Select Layer and Add Blind/Buried Via"), HK_SEL_LAYER_AND_ADD_BLIND_BURIED_VIA, '<'+GR_KB_ALT)
static EDA_HOTKEY HkSwitchGridToFastGrid2(_HKI("Switch Grid To Fast Grid2"), HK_SWITCH_GRID_TO_FASTGRID2, GR_KB_ALT+ '2')
static EDA_HOTKEY HkUndo(_HKI("Undo"), HK_UNDO, GR_KB_CTRL+ 'Z',(int) wxID_UNDO)
void DisplayHotkeyList(EDA_BASE_FRAME *aFrame, struct EDA_HOTKEY_CONFIG *aDescList)
Function DisplayHotkeyList Displays the current hotkey list.
static EDA_HOTKEY HkSwitch2InnerLayer3(_HKI("Switch to Inner layer 3"), HK_SWITCH_LAYER_TO_INNER3, WXK_F7)
static EDA_HOTKEY HkSwitchGridToPrevious(_HKI("Switch Grid To Previous"), HK_SWITCH_GRID_TO_PREVIOUS, 'N'+GR_KB_SHIFT)
struct EDA_HOTKEY_CONFIG g_Pcbnew_Editor_Hokeys_Descr[]
static wxString commonSectionTitle(_HKI("Common"))
static EDA_HOTKEY HkSwitch2CopperLayer(_HKI("Switch to Copper (B.Cu) layer"), HK_SWITCH_LAYER_TO_COPPER, WXK_PAGEDOWN)
static EDA_HOTKEY Hk3DViewer(_HKI("3D Viewer"), HK_3D_VIEWER, GR_KB_ALT+ '3')
EDA_HOTKEY * common_basic_Hotkey_List[]
static wxString boardEditorSectionTag(wxT("[pcbnew]"))
#define GR_KB_SHIFT
Definition: common.h:66
Definition: common.h:145
static EDA_HOTKEY HkAddModule(_HKI("Add Footprint"), HK_ADD_MODULE, 'O')
static EDA_HOTKEY HkSwitch2InnerLayer1(_HKI("Switch to Inner layer 1"), HK_SWITCH_LAYER_TO_INNER1, WXK_F5)
static EDA_HOTKEY HkRedo(_HKI("Redo"), HK_REDO, GR_KB_CTRL+ 'Y',(int) wxID_REDO)
static EDA_HOTKEY HkZoneRemoveFilled(_HKI("Remove Filled Areas in All Zones"), HK_ZONE_REMOVE_FILLED, 'B'+GR_KB_CTRL)
static EDA_HOTKEY HkSwitchTrackWidthToNext(_HKI("Switch Track Width To Next"), HK_SWITCH_TRACK_WIDTH_TO_NEXT, 'W')
static EDA_HOTKEY HkEditWithModedit(_HKI("Edit with Footprint Editor"), HK_EDIT_MODULE_WITH_MODEDIT, 'E'+GR_KB_CTRL)
static EDA_HOTKEY HkMoveItemExact(_HKI("Move Item Exactly"), HK_MOVE_ITEM_EXACT, 'M'+GR_KB_CTRL)
static EDA_HOTKEY HkAddNewTrack(_HKI("Add New Track"), HK_ADD_NEW_TRACK, 'X')
static EDA_HOTKEY HkDuplicateItem(_HKI("Duplicate Item"), HK_DUPLICATE_ITEM, 'D'+GR_KB_CTRL)
static EDA_HOTKEY HkTrackDisplayMode(_HKI("Track Display Mode"), HK_SWITCH_TRACK_DISPLAY_MODE, 'K')
static EDA_HOTKEY HkSavefile(_HKI("Save Board"), HK_SAVE_BOARD, 'S'+GR_KB_CTRL)
static EDA_HOTKEY HkZoomAuto(_HKI("Zoom Auto"), HK_ZOOM_AUTO, WXK_HOME)
void OnLeftClick(wxDC *DC, const wxPoint &MousePos) override
static EDA_HOTKEY HkSavefileAs(_HKI("Save Board As"), HK_SAVE_BOARD_AS, 'S'+GR_KB_CTRL+GR_KB_SHIFT)
static EDA_HOTKEY HkSetGridOrigin(_HKI("Set Grid Origin"), HK_SET_GRID_ORIGIN, 'S')
void OnLeftDClick(wxDC *, const wxPoint &) override
static EDA_HOTKEY HkSwitch2InnerLayer5(_HKI("Switch to Inner layer 5"), HK_SWITCH_LAYER_TO_INNER5, GR_KB_SHIFT+WXK_F5)
static EDA_HOTKEY HkEditBoardItem(_HKI("Edit Item"), HK_EDIT_ITEM, 'E')
EDA_HOTKEY * board_edit_Hotkey_List[]
#define GR_KB_SHIFTCTRL
Definition: common.h:67
static EDA_HOTKEY HkSwitchUnits(_HKI("Switch Units"), HK_SWITCH_UNITS, 'U'+GR_KB_CTRL)
static wxString moduleEditSectionTag(wxT("[footprinteditor]"))
static EDA_HOTKEY HkFindItem(_HKI("Find Item"), HK_FIND_ITEM, 'F'+GR_KB_CTRL)
static EDA_HOTKEY HkAddThroughVia(_HKI("Add Through Via"), HK_ADD_THROUGH_VIA, 'V')
EDA_HOTKEY * GetHotKeyDescription(int aCommand) const override
>
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
static EDA_HOTKEY HkHelp(_HKI("Help (this window)"), HK_HELP, '?')
struct EDA_HOTKEY_CONFIG g_Module_Editor_Hokeys_Descr[]
static EDA_HOTKEY HkCanvasOpenGL(_HKI("Switch to OpenGL Canvas"), HK_CANVAS_OPENGL, WXK_F11)
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:57
static EDA_HOTKEY HkBackspace(_HKI("Delete Track Segment"), HK_BACK_SPACE, WXK_BACK)
static EDA_HOTKEY HkMouseLeftDClick(_HKI("Mouse Left Double Click"), HK_LEFT_DCLICK, WXK_END, 0)
static EDA_HOTKEY HkSwitchGridToFastGrid1(_HKI("Switch Grid To Fast Grid1"), HK_SWITCH_GRID_TO_FASTGRID1, GR_KB_ALT+ '1')
static EDA_HOTKEY HkSelLayerAndAddThroughVia(_HKI("Select Layer and Add Through Via"), HK_SEL_LAYER_AND_ADD_THROUGH_VIA, '<')
static EDA_HOTKEY HkZoomRedraw(_HKI("Zoom Redraw"), HK_ZOOM_REDRAW, WXK_F3)
static EDA_HOTKEY HkCreateArray(_HKI("Create Array"), HK_CREATE_ARRAY, 'N'+GR_KB_CTRL)
static EDA_HOTKEY HkSwitchTrackWidthToPrevious(_HKI("Switch Track Width To Previous"), HK_SWITCH_TRACK_WIDTH_TO_PREVIOUS, 'W'+GR_KB_CTRL)
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
EDA_HOTKEY * module_edit_Hotkey_List[]
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
static EDA_HOTKEY HkSwitch2InnerLayer6(_HKI("Switch to Inner layer 6"), HK_SWITCH_LAYER_TO_INNER6, GR_KB_SHIFT+WXK_F6)
static EDA_HOTKEY HkDragFootprint(_HKI("Drag Item"), HK_DRAG_ITEM, 'G')
static EDA_HOTKEY HkSwitch2InnerLayer2(_HKI("Switch to Inner layer 2"), HK_SWITCH_LAYER_TO_INNER2, WXK_F6)
static EDA_HOTKEY HkResetGridOrigin(_HKI("Reset Grid Origin"), HK_RESET_GRID_ORIGIN, 'Z')
static EDA_HOTKEY HkLoadfile(_HKI("Load Board"), HK_LOAD_BOARD, 'L'+GR_KB_CTRL)
wxString g_CommonSectionTag
static EDA_HOTKEY HkCanvasCairo(_HKI("Switch to Cairo Canvas"), HK_CANVAS_CAIRO, WXK_F12)
static EDA_HOTKEY HkSwitchTrackPosture(_HKI("Switch Track Posture"), HK_SWITCH_TRACK_POSTURE, '/')
static EDA_HOTKEY HkMoveItem(_HKI("Move Item"), HK_MOVE_ITEM, 'M')
static EDA_HOTKEY HkZoomSelection(_HKI("Zoom to Selection"), HK_ZOOM_SELECTION, '@', ID_ZOOM_SELECTION)
EDA_HOTKEY * module_viewer_Hotkey_List[]
#define GR_KB_CTRL
Definition: common.h:64
static EDA_HOTKEY HkResetLocalCoord(_HKI("Reset Local Coordinates"), HK_RESET_LOCAL_COORD, ' ')
#define _HKI(x)
EDA_HOTKEY * common_Hotkey_List[]
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
static EDA_HOTKEY HkLock_Unlock_Footprint(_HKI("Lock/Unlock Footprint"), HK_LOCK_UNLOCK_FOOTPRINT, 'L')
static EDA_HOTKEY HkSwitch2NextCopperLayer(_HKI("Switch to Next Layer"), HK_SWITCH_LAYER_TO_NEXT, '+')
EDA_HOTKEY * GetDescriptorFromCommand(int aCommand, EDA_HOTKEY **aList)
Function GetDescriptorFromCommand Returns a EDA_HOTKEY* pointer from a hot key identifier.
static EDA_HOTKEY HkZoneFillOrRefill(_HKI("Fill or Refill All Zones"), HK_ZONE_FILL_OR_REFILL, 'B')
static EDA_HOTKEY HkPlaceItem(_HKI("Place Item"), HK_PLACE_ITEM, 'P')
struct EDA_HOTKEY_CONFIG g_Module_Viewer_Hokeys_Descr[]