KiCad PCB EDA Suite
eeschema/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) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2008 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
30 #include <fctsys.h>
31 #include <eeschema_id.h>
32 #include <hotkeys.h>
33 #include <sch_edit_frame.h>
34 #include <class_drawpanel.h>
35 
36 #include <general.h>
37 #include <lib_edit_frame.h>
38 #include <viewlib_frame.h>
39 #include <class_libentry.h>
40 #include <sch_junction.h>
41 #include <sch_line.h>
42 #include <sch_component.h>
43 #include <sch_sheet.h>
44 
46 
47 // Remark: the hotkey message info is used as keyword in hotkey config files and
48 // as comments in help windows, therefore translated only when displayed
49 // they are marked _HKI to be extracted by translation tools
50 // See hotkeys_basic.h for more info
51 
52 
53 /* How to add a new hotkey:
54  * add a new id in the enum hotkey_id_command like MY_NEW_ID_FUNCTION (see
55  * hotkeys.h).
56  * add a new EDA_HOTKEY entry like:
57  * static EDA_HOTKEY HkMyNewEntry(_HKI("Command Label"), MY_NEW_ID_FUNCTION,
58  * default key value);
59  * _HKI("Command Label") is the name used in hotkey list display, and the
60  * identifier in the hotkey list file
61  * MY_NEW_ID_FUNCTION is an equivalent id function used in the switch in
62  * OnHotKey() function.
63  * default key value is the default hotkey for this command. Can be overridden
64  * by the user hotkey list file
65  * add the HkMyNewEntry pointer in the schematic_Hotkey_List list or the
66  * libEdit_Hotkey_List list or common_Hotkey_List if the same command is
67  * added both in Eeschema and libedit)
68  * Add the new code in the switch in OnHotKey() function.
69  * when the variable itemInEdit is true, an item is currently edited.
70  * This can be useful if the new function cannot be executed while an item is
71  * currently being edited
72  * ( For example, one cannot start a new wire when a component is moving.)
73  *
74  * Note: If an hotkey is a special key be sure the corresponding wxWidget
75  * keycode (WXK_XXXX) is handled in the hotkey_name_descr
76  * s_Hotkey_Name_List list (see hotkeys_basic.cpp) and see this list
77  * for some ascii keys (space ...)
78  *
79  * Key modifier are: GR_KB_CTRL GR_KB_ALT
80  */
81 
82 
83 // Common commands
84 
85 // Fit on Screen
86 #if !defined( __WXMAC__ )
87 static EDA_HOTKEY HkZoomAuto( _HKI( "Fit on Screen" ), HK_ZOOM_AUTO, WXK_HOME, ID_ZOOM_PAGE );
88 #else
89 static EDA_HOTKEY HkZoomAuto( _HKI( "Zoom Auto" ), HK_ZOOM_AUTO, GR_KB_CTRL + '0',
90  ID_ZOOM_PAGE );
91 #endif
92 
93 static EDA_HOTKEY HkZoomCenter( _HKI( "Zoom Center" ), HK_ZOOM_CENTER, WXK_F4,
95 
96 // Refresh Screen
97 #if !defined( __WXMAC__ )
98 static EDA_HOTKEY HkZoomRedraw( _HKI( "Zoom Redraw" ), HK_ZOOM_REDRAW, WXK_F3, ID_ZOOM_REDRAW );
99 #else
100 static EDA_HOTKEY HkZoomRedraw( _HKI( "Zoom Redraw" ), HK_ZOOM_REDRAW, GR_KB_CTRL + 'R',
101  ID_ZOOM_REDRAW );
102 #endif
103 
104 // Zoom In
105 #if !defined( __WXMAC__ )
106 static EDA_HOTKEY HkZoomIn( _HKI( "Zoom In" ), HK_ZOOM_IN, WXK_F1, ID_KEY_ZOOM_IN );
107 #else
108 static EDA_HOTKEY HkZoomIn( _HKI( "Zoom In" ), HK_ZOOM_IN, GR_KB_CTRL + '+', ID_KEY_ZOOM_IN );
109 #endif
110 
111 // Zoom Out
112 #if !defined( __WXMAC__ )
113 static EDA_HOTKEY HkZoomOut( _HKI( "Zoom Out" ), HK_ZOOM_OUT, WXK_F2, ID_KEY_ZOOM_OUT );
114 #else
115 static EDA_HOTKEY HkZoomOut( _HKI( "Zoom Out" ), HK_ZOOM_OUT, GR_KB_CTRL + '-', ID_KEY_ZOOM_OUT );
116 #endif
117 
118 static EDA_HOTKEY HkHelp( _HKI( "Help (this window)" ), HK_HELP, '?' );
119 static EDA_HOTKEY HkResetLocalCoord( _HKI( "Reset Local Coordinates" ), HK_RESET_LOCAL_COORD, ' ' );
120 static EDA_HOTKEY HkLeaveSheet( _HKI( "Leave Sheet" ), HK_LEAVE_SHEET, GR_KB_ALT + WXK_BACK,
122 
123 // Undo
124 static EDA_HOTKEY HkUndo( _HKI( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z', (int) wxID_UNDO );
125 
126 // Redo
127 #if !defined( __WXMAC__ )
128 static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y', (int) wxID_REDO );
129 #else
130 static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO, GR_KB_SHIFT + GR_KB_CTRL + 'Z',
131  (int) wxID_REDO );
132 #endif
133 
134 // mouse click command:
135 static EDA_HOTKEY HkMouseLeftClick( _HKI( "Mouse Left Click" ), HK_LEFT_CLICK, WXK_RETURN, 0 );
136 static EDA_HOTKEY HkMouseLeftDClick( _HKI( "Mouse Left Double Click" ), HK_LEFT_DCLICK, WXK_END, 0 );
137 
138 // Schematic editor
139 static EDA_HOTKEY HkBeginWire( _HKI( "Begin Wire" ), HK_BEGIN_WIRE, 'W', ID_WIRE_BUTT );
140 static EDA_HOTKEY HkBeginBus( _HKI( "Begin Bus" ), HK_BEGIN_BUS, 'B', ID_BUS_BUTT );
141 static EDA_HOTKEY HkEndLineWireBus( _HKI( "End Line Wire Bus" ), HK_END_CURR_LINEWIREBUS, 'K',
143 
144 static EDA_HOTKEY HkAddLabel( _HKI( "Add Label" ), HK_ADD_LABEL, 'L', ID_LABEL_BUTT );
145 static EDA_HOTKEY HkAddHierarchicalLabel( _HKI( "Add Hierarchical Label" ), HK_ADD_HLABEL, 'H',
147 static EDA_HOTKEY HkAddGlobalLabel( _HKI( "Add Global Label" ), HK_ADD_GLABEL, GR_KB_CTRL + 'H',
148  ID_GLABEL_BUTT );
149 static EDA_HOTKEY HkAddJunction( _HKI( "Add Junction" ), HK_ADD_JUNCTION, 'J', ID_JUNCTION_BUTT );
150 static EDA_HOTKEY HkAddComponent( _HKI( "Add Symbol" ), HK_ADD_NEW_COMPONENT, 'A',
152 static EDA_HOTKEY HkAddPower( _HKI( "Add Power" ), HK_ADD_NEW_POWER, 'P',
154 static EDA_HOTKEY HkAddNoConn( _HKI( "Add No Connect Flag" ), HK_ADD_NOCONN_FLAG, 'Q',
155  ID_NOCONN_BUTT );
156 static EDA_HOTKEY HkAddHierSheet( _HKI( "Add Sheet" ), HK_ADD_HIER_SHEET, 'S',
158 static EDA_HOTKEY HkAddBusEntry( _HKI( "Add Bus Entry" ), HK_ADD_BUS_ENTRY, '/',
160 static EDA_HOTKEY HkAddWireEntry( _HKI( "Add Wire Entry" ), HK_ADD_WIRE_ENTRY, 'Z',
162 static EDA_HOTKEY HkAddGraphicPolyLine( _HKI( "Add Graphic PolyLine" ), HK_ADD_GRAPHIC_POLYLINE,
163  'I', ID_LINE_COMMENT_BUTT );
164 static EDA_HOTKEY HkAddGraphicText( _HKI( "Add Graphic Text" ), HK_ADD_GRAPHIC_TEXT, 'T',
166 static EDA_HOTKEY HkMirrorY( _HKI( "Mirror Y" ), HK_MIRROR_Y, 'Y',
167  ID_SCH_MIRROR_Y );
168 static EDA_HOTKEY HkMirrorX( _HKI( "Mirror X" ), HK_MIRROR_X, 'X',
169  ID_SCH_MIRROR_X );
170 static EDA_HOTKEY HkOrientNormalComponent( _HKI( "Orient Normal Component" ),
172 static EDA_HOTKEY HkRotate( _HKI( "Rotate Item" ), HK_ROTATE, 'R', ID_SCH_ROTATE_CLOCKWISE );
173 static EDA_HOTKEY HkEdit( _HKI( "Edit Item" ), HK_EDIT, 'E', ID_SCH_EDIT_ITEM );
174 static EDA_HOTKEY HkEditComponentValue( _HKI( "Edit Symbol Value" ),
177 static EDA_HOTKEY HkEditComponentReference( _HKI( "Edit Symbol Reference" ),
180 static EDA_HOTKEY HkEditComponentFootprint( _HKI( "Edit Symbol Footprint" ),
183 static EDA_HOTKEY HkEditComponentWithLibedit( _HKI( "Edit with Symbol Editor" ),
185  'E' + GR_KB_CTRL,
187 static EDA_HOTKEY HkMove( _HKI( "Move Schematic Item" ),
190 
191 static EDA_HOTKEY HkDuplicateItem( _HKI( "Duplicate Symbol or Label" ),
192  HK_DUPLICATE_ITEM, 'C',
194 
195 static EDA_HOTKEY HkDrag( _HKI( "Drag Item" ), HK_DRAG, 'G', ID_SCH_DRAG_ITEM );
196 static EDA_HOTKEY HkCopyBlock( _HKI( "Copy Block" ), HK_COPY_BLOCK, 'C' + GR_KB_CTRL, wxID_COPY );
197 static EDA_HOTKEY HkPasteBlock( _HKI( "Paste Block" ), HK_PASTE_BLOCK, 'V' + GR_KB_CTRL, wxID_PASTE );
198 static EDA_HOTKEY HkCutBlock( _HKI( "Cut Block" ), HK_CUT_BLOCK, 'X' + GR_KB_CTRL, wxID_CUT );
199 static EDA_HOTKEY HkMove2Drag( _HKI( "Move Block -> Drag Block" ),
201 static EDA_HOTKEY HkInsert( _HKI( "Repeat Last Item" ), HK_REPEAT_LAST, WXK_INSERT );
202 static EDA_HOTKEY HkDelete( _HKI( "Delete Item" ), HK_DELETE, WXK_DELETE );
203 static EDA_HOTKEY HkDeleteNode( _HKI( "Delete Node" ), HK_DELETE_NODE, WXK_BACK,
205 
206 static EDA_HOTKEY HkFindItem( _HKI( "Find Item" ), HK_FIND_ITEM, 'F' + GR_KB_CTRL, ID_FIND_ITEMS );
207 static EDA_HOTKEY HkFindNextItem( _HKI( "Find Next Item" ), HK_FIND_NEXT_ITEM, WXK_F5,
208  wxEVT_COMMAND_FIND );
209 static EDA_HOTKEY HkFindReplace( _HKI( "Find and Replace" ), HK_FIND_REPLACE,
210  'F' + GR_KB_CTRL + GR_KB_ALT, wxID_REPLACE );
211 static EDA_HOTKEY HkFindNextDrcMarker( _HKI( "Find Next DRC Marker" ), HK_FIND_NEXT_DRC_MARKER,
212  WXK_F5 + GR_KB_SHIFT, EVT_COMMAND_FIND_DRC_MARKER );
213 static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTION, '@', ID_ZOOM_SELECTION );
214 
215 // Special keys for library editor:
216 static EDA_HOTKEY HkCreatePin( _HKI( "Create Pin" ), HK_LIBEDIT_CREATE_PIN, 'P' );
217 static EDA_HOTKEY HkInsertPin( _HKI( "Repeat Pin" ), HK_REPEAT_LAST, WXK_INSERT );
218 static EDA_HOTKEY HkMoveLibItem( _HKI( "Move Library Item" ), HK_LIBEDIT_MOVE_GRAPHIC_ITEM, 'M' );
219 
220 // Load/save files
221 static EDA_HOTKEY HkSaveAllLib( _HKI( "Save All Libraries" ), HK_SAVE_ALL_LIBS, 'S' + GR_KB_CTRL, ID_LIBEDIT_SAVE_ALL_LIBS );
222 static EDA_HOTKEY HkSaveSchematic( _HKI( "Save Schematic" ), HK_SAVE_SCH, 'S' + GR_KB_CTRL );
223 static EDA_HOTKEY HkLoadSchematic( _HKI( "Load Schematic" ), HK_LOAD_SCH, 'L' + GR_KB_CTRL );
224 
225 // Autoplace fields
226 static EDA_HOTKEY HkAutoplaceFields( _HKI( "Autoplace Fields" ), HK_AUTOPLACE_FIELDS, 'O',
228 
229 static EDA_HOTKEY HkUpdatePcbFromSch( _HKI( "Update PCB from Schematic" ), HK_UPDATE_PCB_FROM_SCH,
230  WXK_F8 );
231 
232 // Higtlight connection
233 static EDA_HOTKEY HkHighlightConnection( _HKI( "Highlight Connection" ), ID_HOTKEY_HIGHLIGHT,
234  'B' + GR_KB_CTRL );
235 
236 // List of common hotkey descriptors
238 {
239  &HkHelp,
240  &HkZoomIn,
241  &HkZoomOut,
242  &HkZoomRedraw,
243  &HkZoomCenter,
244  &HkZoomAuto,
247  &HkEdit,
248  &HkDelete,
249  &HkRotate,
250  &HkDrag,
251  &HkUndo,
252  &HkRedo,
255  NULL
256 };
257 
258 // List of common hotkey descriptors, for the library vierwer
260 {
261  &HkHelp,
262  &HkZoomIn,
263  &HkZoomOut,
264  &HkZoomRedraw,
265  &HkZoomCenter,
266  &HkZoomAuto,
270  NULL
271 };
272 
273 // List of hotkey descriptors for schematic
275 {
278  &HkFindItem,
281  &HkFindReplace,
282  &HkInsert,
283  &HkMove2Drag,
284  &HkCopyBlock,
285  &HkPasteBlock,
286  &HkCutBlock,
287  &HkMove,
290  &HkAddPower,
291  &HkMirrorX,
292  &HkMirrorY,
298  &HkBeginWire,
299  &HkBeginBus,
301  &HkAddLabel,
304  &HkAddJunction,
305  &HkAddNoConn,
308  &HkAddBusEntry,
313  &HkLeaveSheet,
314  &HkDeleteNode,
316  NULL
317 };
318 
319 // List of hotkey descriptors for library editor
321 {
322  &HkSaveAllLib,
323  &HkCreatePin,
324  &HkInsertPin,
325  &HkMoveLibItem,
326  &HkMirrorX,
327  &HkMirrorY,
328  &HkCopyBlock,
329  &HkPasteBlock,
330  &HkCutBlock,
331  NULL
332 };
333 
334 // List of hotkey descriptors for library viewer (currently empty
336 {
337  NULL
338 };
339 
340 // Keyword Identifiers (tags) in key code configuration file (section names)
341 // (.m_SectionTag member of a EDA_HOTKEY_CONFIG)
342 static wxString schematicSectionTag( wxT( "[eeschema]" ) );
343 static wxString libEditSectionTag( wxT( "[libedit]" ) );
344 
345 // Titles for hotkey editor and hotkey display
346 static wxString commonSectionTitle( _HKI( "Common" ) );
347 static wxString schematicSectionTitle( _HKI( "Schematic Editor" ) );
348 static wxString libEditSectionTitle( _HKI( "Library Editor" ) );
349 
350 // list of sections and corresponding hotkey list for Eeschema (used to create
351 // an hotkey config file)
353 {
354  { &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
355  { &schematicSectionTag, schematic_Hotkey_List, &schematicSectionTitle },
356  { &libEditSectionTag, libEdit_Hotkey_List, &libEditSectionTitle },
357  { NULL, NULL, NULL }
358 };
359 
360 // list of sections and corresponding hotkey list for the schematic editor
361 // (used to list current hotkeys)
363 {
364  { &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
365  { &schematicSectionTag, schematic_Hotkey_List, &schematicSectionTitle },
366  { NULL, NULL, NULL }
367 };
368 
369 // list of sections and corresponding hotkey list for the component editor
370 // (used to list current hotkeys)
372 {
373  { &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
374  { &libEditSectionTag, libEdit_Hotkey_List, &libEditSectionTitle },
375  { NULL, NULL, NULL }
376 };
377 
378 // list of sections and corresponding hotkey list for the component browser
379 // (used to list current hotkeys)
381 {
382  { &g_CommonSectionTag, common_basic_Hotkey_List, &commonSectionTitle },
383  { NULL, NULL, NULL }
384 };
385 
386 
388 {
389  EDA_HOTKEY* HK_Descr = GetDescriptorFromCommand( aCommand, common_Hotkey_List );
390 
391  if( HK_Descr == NULL )
392  HK_Descr = GetDescriptorFromCommand( aCommand, schematic_Hotkey_List );
393 
394  return HK_Descr;
395 }
396 
397 
398 /*
399  * Hot keys. Some commands are relative to the item under the mouse cursor
400  * Commands are case insensitive
401  */
402 bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, EDA_ITEM* aItem )
403 {
404  if( aHotKey == 0 )
405  return false;
406 
407  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
408 
409  SCH_SCREEN* screen = GetScreen();
410 
411  // itemInEdit == false means no item currently edited. We can ask for editing a new item
412  bool itemInEdit = screen->GetCurItem() && screen->GetCurItem()->GetFlags();
413 
414  // blocInProgress == false means no block in progress.
415  // Because a drag command uses a drag block, false means also no drag in progress
416  // If false, we can ask for editing a new item
417  bool blocInProgress = screen->m_BlockLocate.GetState() != STATE_NO_BLOCK;
418 
419  // notBusy == true means no item currently edited and no other command in progress
420  // We can change active tool and ask for editing a new item
421  bool notBusy = (!itemInEdit) && (!blocInProgress);
422 
423  /* Convert lower to upper case (the usual toupper function has problem
424  * with non ascii codes like function keys */
425  if( (aHotKey >= 'a') && (aHotKey <= 'z') )
426  aHotKey += 'A' - 'a';
427 
428  // Search command from key :
429  EDA_HOTKEY* hotKey = GetDescriptorFromHotkey( aHotKey, common_Hotkey_List );
430 
431  if( hotKey == NULL )
432  hotKey = GetDescriptorFromHotkey( aHotKey, schematic_Hotkey_List );
433 
434  if( hotKey == NULL )
435  return false;
436 
437  switch( hotKey->m_Idcommand )
438  {
439  default:
440  case HK_NOT_FOUND:
441  return false;
442 
443  case HK_HELP: // Display Current hotkey list
444  DisplayHotkeyList( this, g_Schematic_Hokeys_Descr );
445  break;
446 
447  case HK_RESET_LOCAL_COORD: // Reset the relative coord
449  break;
450 
451  case ID_HOTKEY_HIGHLIGHT:
452  if( notBusy )
454  break;
455 
456  case HK_LEFT_CLICK:
457  case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events
458  if( screen->m_BlockLocate.GetState() == STATE_BLOCK_MOVE )
459  {
460  GetCanvas()->SetAutoPanRequest( false );
461  HandleBlockPlace( aDC );
462  }
463  else if( screen->m_BlockLocate.GetState() == STATE_NO_BLOCK )
464  {
465  OnLeftClick( aDC, aPosition );
466 
467  if( hotKey->m_Idcommand == HK_LEFT_DCLICK )
468  OnLeftDClick( aDC, aPosition );
469  }
470  break;
471 
472  case HK_ZOOM_IN:
473  case HK_ZOOM_OUT:
474  case HK_ZOOM_REDRAW:
475  case HK_ZOOM_CENTER:
476  case HK_ZOOM_AUTO:
477  case HK_ZOOM_SELECTION:
478  case HK_MOVEBLOCK_TO_DRAGBLOCK: // Switch to drag mode, when block moving
479  case HK_PASTE_BLOCK:
480  case HK_COPY_BLOCK: // Copy block to paste buffer.
481  case HK_CUT_BLOCK:
482  cmd.SetId( hotKey->m_IdMenuEvent );
483  GetEventHandler()->ProcessEvent( cmd );
484  break;
485 
486  case HK_DELETE:
487  if( blocInProgress )
488  {
489  cmd.SetId( ID_POPUP_DELETE_BLOCK );
490  GetEventHandler()->ProcessEvent( cmd );
491  }
492  else if( notBusy )
493  DeleteItemAtCrossHair( aDC );
494  break;
495 
496  case HK_REPEAT_LAST:
497  if( notBusy )
498  RepeatDrawItem( aDC );
499  break;
500 
502  // this key terminates a new line/bus/wire in progress
503  if( aItem && aItem->IsNew() &&
504  aItem->Type() == SCH_LINE_T )
505  {
506  cmd.SetId( hotKey->m_IdMenuEvent );
507  GetEventHandler()->ProcessEvent( cmd );
508  }
509  break;
510 
511  case HK_UNDO: // Hot keys that map to command IDs that cannot be called
512  case HK_REDO: // while busy performing another command.
513  case HK_FIND_ITEM:
514  case HK_FIND_REPLACE:
515  case HK_DELETE_NODE:
516  case HK_LEAVE_SHEET:
517  if( notBusy )
518  {
519  cmd.SetId( hotKey->m_IdMenuEvent );
520  GetEventHandler()->ProcessEvent( cmd );
521  }
522  break;
523 
524  case HK_FIND_NEXT_ITEM:
526  if( notBusy )
527  {
528  wxFindDialogEvent event( hotKey->m_IdMenuEvent, GetId() );
529  event.SetEventObject( this );
530  event.SetFlags( m_findReplaceData->GetFlags() );
531  event.SetFindString( m_findReplaceData->GetFindString() );
532  GetEventHandler()->ProcessEvent( event );
533  }
534  break;
535 
536  case HK_ADD_NEW_COMPONENT: // Add component
537  case HK_ADD_NEW_POWER: // Add power component
538  case HK_ADD_LABEL:
539  case HK_ADD_HLABEL:
540  case HK_ADD_GLABEL:
541  case HK_ADD_JUNCTION:
542  case HK_ADD_WIRE_ENTRY:
543  case HK_ADD_BUS_ENTRY:
544  case HK_ADD_HIER_SHEET:
545  case HK_ADD_GRAPHIC_TEXT:
547  case HK_ADD_NOCONN_FLAG: // Add a no connected flag
548  case HK_BEGIN_BUS:
549  case HK_BEGIN_WIRE:
550  if( notBusy )
551  {
552  EDA_HOTKEY_CLIENT_DATA data( aPosition );
553  cmd.SetInt( aHotKey );
554  cmd.SetClientObject( &data );
555  cmd.SetId( hotKey->m_IdMenuEvent );
556  GetEventHandler()->ProcessEvent( cmd );
557  }
558  else if( aItem && aItem->IsNew() )
559  {
560  // If the item is a bus or a wire, a begin command is not possible.
561  if( (GetToolId() == ID_BUS_BUTT) && (aItem->Type() == SCH_LINE_T) )
562  {
563  SCH_LINE* segment = (SCH_LINE*) aItem;
564 
565  if( segment->GetLayer() != LAYER_BUS )
566  break;
567 
568  // Bus in progress:
569  OnLeftClick( aDC, aPosition );
570  }
571  else if( (GetToolId() == ID_WIRE_BUTT ) && (aItem->Type() == SCH_LINE_T) )
572  {
573  SCH_LINE* segment = (SCH_LINE*) aItem;
574 
575  if( segment->GetLayer() != LAYER_WIRE )
576  break;
577 
578  // Wire in progress:
579  OnLeftClick( aDC, aPosition );
580  }
581  }
582  break;
583 
584  case HK_DUPLICATE_ITEM: // Duplicate component or text/label
585  if( itemInEdit )
586  break;
587 
588  if( aItem == NULL )
589  {
590  aItem = LocateAndShowItem( aPosition, SCH_COLLECTOR::CopyableItems );
591 
592  if( aItem == NULL )
593  break;
594  }
595 
596  cmd.SetId( hotKey->m_IdMenuEvent );
597  wxPostEvent( this, cmd );
598  break;
599 
600  case HK_DRAG: // Start drag
601  case HK_MOVE_COMPONENT_OR_ITEM: // Start move schematic item.
602  if( ! notBusy )
603  break;
604 
605  // Fall through
606  case HK_EDIT:
607  // Edit schematic item. Do not allow sheet edition when mowing
608  // Because a sheet edition can be complex.
609  if( itemInEdit && screen->GetCurItem()->Type() == SCH_SHEET_T )
610  break;
611 
612  // Fall through
613  case HK_EDIT_COMPONENT_VALUE: // Edit component value field.
614  case HK_EDIT_COMPONENT_REFERENCE: // Edit component value reference.
615  case HK_EDIT_COMPONENT_FOOTPRINT: // Edit component footprint field.
616  case HK_MIRROR_Y: // Mirror Y
617  case HK_MIRROR_X: // Mirror X
618  case HK_ORIENT_NORMAL_COMPONENT: // Orient 0, no mirror (Component)
619  case HK_ROTATE: // Rotate schematic item.
620  case HK_EDIT_COMPONENT_WITH_LIBEDIT: // Call Libedit and load the current component
621  case HK_AUTOPLACE_FIELDS: // Autoplace all fields around component
622  {
623  // force a new item search on hot keys at current position,
624  // if there is no currently edited item,
625  // to avoid using a previously selected item
626  if( ! itemInEdit )
627  screen->SetCurItem( NULL );
628  EDA_HOTKEY_CLIENT_DATA data( aPosition );
629  cmd.SetInt( hotKey->m_Idcommand );
630  cmd.SetClientObject( &data );
631  cmd.SetId( hotKey->m_IdMenuEvent );
632  GetEventHandler()->ProcessEvent( cmd );
633  }
634  break;
635  }
636 
637  // Hot key handled.
638  return true;
639 }
640 
641 
643 {
644  EDA_HOTKEY* HK_Descr = GetDescriptorFromCommand( aCommand, common_Hotkey_List );
645 
646  if( HK_Descr == NULL )
647  HK_Descr = GetDescriptorFromCommand( aCommand, libEdit_Hotkey_List );
648 
649  return HK_Descr;
650 }
651 
652 
653 bool LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, EDA_ITEM* aItem )
654 {
655  if( aHotKey == 0 )
656  return false;
657 
658  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
659 
660  cmd.SetEventObject( this );
661 
662  /* Convert lower to upper case (the usual toupper function has problem
663  * with non ascii codes like function keys */
664  if( (aHotKey >= 'a') && (aHotKey <= 'z') )
665  aHotKey += 'A' - 'a';
666 
667  EDA_HOTKEY* hotKey = GetDescriptorFromHotkey( aHotKey, common_Hotkey_List );
668 
669  if( hotKey == NULL )
670  hotKey = GetDescriptorFromHotkey( aHotKey, libEdit_Hotkey_List );
671 
672  if( hotKey == NULL )
673  return false;
674 
675  // itemInEdit == false means no item currently edited. We can ask for editing a new item
676  bool itemInEdit = IsEditingDrawItem();
677 
678  bool blocInProgress = GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK;
679 
680  switch( hotKey->m_Idcommand )
681  {
682  default:
683  case HK_NOT_FOUND:
684  return false;
685 
686  case HK_HELP: // Display Current hotkey list
687  DisplayHotkeyList( this, g_Libedit_Hokeys_Descr );
688  break;
689 
690  case HK_RESET_LOCAL_COORD: // Reset the relative coord
692  break;
693 
694  case HK_LEFT_CLICK:
695  OnLeftClick( aDC, aPosition );
696  break;
697 
698  case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events
699  OnLeftClick( aDC, aPosition );
700  OnLeftDClick( aDC, aPosition );
701  break;
702 
703  case HK_ZOOM_IN:
704  case HK_ZOOM_OUT:
705  case HK_ZOOM_REDRAW:
706  case HK_ZOOM_CENTER:
707  case HK_ZOOM_AUTO:
708  case HK_PASTE_BLOCK:
709  case HK_COPY_BLOCK:
710  case HK_CUT_BLOCK:
711  cmd.SetId( hotKey->m_IdMenuEvent );
712  GetEventHandler()->ProcessEvent( cmd );
713  break;
714 
715  case HK_UNDO:
716  case HK_REDO:
717  if( !itemInEdit )
718  {
719  cmd.SetId( hotKey->m_IdMenuEvent );
720  GetEventHandler()->ProcessEvent( cmd );
721  }
722  break;
723 
724  case HK_REPEAT_LAST:
725  if( ! itemInEdit )
726  {
727  if( m_lastDrawItem && !m_lastDrawItem->InEditMode() &&
728  ( m_lastDrawItem->Type() == LIB_PIN_T ) )
729  RepeatPinItem( aDC, (LIB_PIN*) m_lastDrawItem );
730  }
731  break;
732 
733  case HK_EDIT:
734  if ( !itemInEdit )
735  SetDrawItem( LocateItemUsingCursor( aPosition ) );
736 
737  if( GetDrawItem() )
738  {
739  switch( GetDrawItem()->Type() )
740  {
741  case LIB_PIN_T:
742  cmd.SetId( ID_LIBEDIT_EDIT_PIN );
743  GetEventHandler()->ProcessEvent( cmd );
744  break;
745 
746  case LIB_ARC_T:
747  case LIB_CIRCLE_T:
748  case LIB_RECTANGLE_T:
749  case LIB_POLYLINE_T:
750  case LIB_TEXT_T:
751  cmd.SetId( ID_POPUP_LIBEDIT_BODY_EDIT_ITEM );
752  GetEventHandler()->ProcessEvent( cmd );
753  break;
754 
755  case LIB_FIELD_T:
757  GetEventHandler()->ProcessEvent( cmd );
758  break;
759 
760  default:
761  break;
762  }
763  }
764  break;
765 
766  case HK_ROTATE:
767  if( blocInProgress )
768  {
770  HandleBlockPlace( aDC );
771  }
772  else
773  {
774  if ( !itemInEdit )
775  SetDrawItem( LocateItemUsingCursor( aPosition ) );
776 
777  if( GetDrawItem() )
778  {
779  cmd.SetId( ID_LIBEDIT_ROTATE_ITEM );
780  GetEventHandler()->ProcessEvent( cmd );
781  }
782  }
783  break;
784 
786  if( ! itemInEdit )
787  {
788  SetToolID( ID_LIBEDIT_PIN_BUTT, wxCURSOR_PENCIL, _( "Add Pin" ) );
789  OnLeftClick( aDC, aPosition );
790  }
791  break;
792 
793  case HK_DELETE:
794  if ( !itemInEdit )
795  SetDrawItem( LocateItemUsingCursor( aPosition ) );
796 
797  if( GetDrawItem() )
798  {
799  cmd.SetId( ID_POPUP_LIBEDIT_DELETE_ITEM );
801  }
802  break;
803 
805  if( !itemInEdit )
806  {
807  SetDrawItem( LocateItemUsingCursor( aPosition ) );
808 
809  if( GetDrawItem() )
810  {
813  }
814  }
815  break;
816 
817  case HK_DRAG:
818  if( !itemInEdit )
819  {
820  SetDrawItem( LocateItemUsingCursor( aPosition ) );
821 
822  if( GetDrawItem() )
823  {
824  cmd.SetId( ID_POPUP_LIBEDIT_MODIFY_ITEM );
826  }
827  }
828  break;
829 
830  case HK_MIRROR_Y: // Mirror Y
831  if( !itemInEdit )
832  SetDrawItem( LocateItemUsingCursor( aPosition ) );
833 
834  cmd.SetId( ID_LIBEDIT_MIRROR_Y );
835  GetEventHandler()->ProcessEvent( cmd );
836  break;
837 
838  case HK_MIRROR_X: // Mirror X
839  if( !itemInEdit )
840  SetDrawItem( LocateItemUsingCursor( aPosition ) );
841 
842  cmd.SetId( ID_LIBEDIT_MIRROR_X );
843  GetEventHandler()->ProcessEvent( cmd );
844  break;
845  }
846 
847  // Hot key handled.
848  return true;
849 }
850 
851 
853 {
854  EDA_HOTKEY* HK_Descr = GetDescriptorFromCommand( aCommand, common_Hotkey_List );
855 
856  if( HK_Descr == NULL )
857  HK_Descr = GetDescriptorFromCommand( aCommand, viewlib_Hotkey_List );
858 
859  return HK_Descr;
860 }
861 
862 
863 bool LIB_VIEW_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, EDA_ITEM* aItem )
864 {
865  if( aHotKey == 0 )
866  return false;
867 
868  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
869  cmd.SetEventObject( this );
870 
871  /* Convert lower to upper case (the usual toupper function has problem with non ascii
872  * codes like function keys */
873  if( (aHotKey >= 'a') && (aHotKey <= 'z') )
874  aHotKey += 'A' - 'a';
875 
876  EDA_HOTKEY* HK_Descr = GetDescriptorFromHotkey( aHotKey, common_basic_Hotkey_List );
877 
878  if( HK_Descr == NULL )
879  HK_Descr = GetDescriptorFromHotkey( aHotKey, viewlib_Hotkey_List );
880 
881  if( HK_Descr == NULL )
882  return false;
883 
884  switch( HK_Descr->m_Idcommand )
885  {
886  default:
887  case HK_NOT_FOUND:
888  return false;
889 
890  case HK_HELP: // Display Current hotkey list
891  DisplayHotkeyList( this, g_Viewlib_Hokeys_Descr );
892  break;
893 
894  case HK_RESET_LOCAL_COORD: // set local (relative) coordinate origin
896  break;
897 
898  case HK_LEFT_CLICK:
899  OnLeftClick( aDC, aPosition );
900  break;
901 
902  case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events
903  OnLeftClick( aDC, aPosition );
904  OnLeftDClick( aDC, aPosition );
905  break;
906 
907  case HK_ZOOM_IN:
908  cmd.SetId( ID_KEY_ZOOM_IN );
909  GetEventHandler()->ProcessEvent( cmd );
910  break;
911 
912  case HK_ZOOM_OUT:
913  cmd.SetId( ID_KEY_ZOOM_OUT );
914  GetEventHandler()->ProcessEvent( cmd );
915  break;
916 
917  case HK_ZOOM_REDRAW:
918  cmd.SetId( ID_ZOOM_REDRAW );
919  GetEventHandler()->ProcessEvent( cmd );
920  break;
921 
922  case HK_ZOOM_CENTER:
923  cmd.SetId( ID_POPUP_ZOOM_CENTER );
924  GetEventHandler()->ProcessEvent( cmd );
925  break;
926 
927  case HK_ZOOM_AUTO:
928  cmd.SetId( ID_ZOOM_PAGE );
929  GetEventHandler()->ProcessEvent( cmd );
930  break;
931  }
932 
933  return true;
934 }
Definition of the SCH_SHEET class for Eeschema.
void RepeatDrawItem(wxDC *DC)
Repeat the last item placement if the last item was a bus, bus entry, label, or component.
static EDA_HOTKEY HkEndLineWireBus(_HKI("End Line Wire Bus"), HK_END_CURR_LINEWIREBUS, 'K', ID_POPUP_END_LINE)
KICAD_T Type() const
Function Type()
Definition: base_struct.h:227
bool OnHotKey(wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
static EDA_HOTKEY HkAddGraphicText(_HKI("Add Graphic Text"), HK_ADD_GRAPHIC_TEXT, 'T', ID_TEXT_COMMENT_BUTT)
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:284
static EDA_HOTKEY HkFindReplace(_HKI("Find and Replace"), HK_FIND_REPLACE, 'F'+GR_KB_CTRL+GR_KB_ALT, wxID_REPLACE)
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
Definition: base_screen.h:214
Structure EDA_HOTKEY_CONFIG contains the information required to save hot key information to a config...
Definition: hotkeys_basic.h:87
static EDA_HOTKEY HkAddWireEntry(_HKI("Add Wire Entry"), HK_ADD_WIRE_ENTRY, 'Z', ID_WIRETOBUS_ENTRY_BUTT)
bool OnHotKey(wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
static wxString schematicSectionTag(wxT("[eeschema]"))
static EDA_HOTKEY HkEditComponentFootprint(_HKI("Edit Symbol Footprint"), HK_EDIT_COMPONENT_FOOTPRINT, 'F', ID_SCH_EDIT_COMPONENT_FOOTPRINT)
static EDA_HOTKEY * schematic_Hotkey_List[]
bool IsNew() const
Definition: base_struct.h:245
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:342
static EDA_HOTKEY HkSaveSchematic(_HKI("Save Schematic"), HK_SAVE_SCH, 'S'+GR_KB_CTRL)
EDA_HOTKEY * GetHotKeyDescription(int aCommand) const override
>
static EDA_HOTKEY HkAddLabel(_HKI("Add Label"), HK_ADD_LABEL, 'L', ID_LABEL_BUTT)
static EDA_HOTKEY HkZoomIn(_HKI("Zoom In"), HK_ZOOM_IN, WXK_F1, ID_KEY_ZOOM_IN)
static EDA_HOTKEY HkMoveLibItem(_HKI("Move Library Item"), HK_LIBEDIT_MOVE_GRAPHIC_ITEM, 'M')
static EDA_HOTKEY HkHelp(_HKI("Help (this window)"), HK_HELP, '?')
struct EDA_HOTKEY_CONFIG g_Libedit_Hokeys_Descr[]
wxFindReplaceData * m_findReplaceData
SCH_ITEM * LocateAndShowItem(const wxPoint &aPosition, const KICAD_T aFilterList[]=SCH_COLLECTOR::AllItems, int aHotKeyCommandId=0, bool *clarifySelectionMenuCancelled=nullptr)
Check the schematic at aPosition in logical (drawing) units for a item matching the types in aFilterL...
SCH_LAYER_ID GetLayer() const
Function GetLayer returns the layer this item is on.
virtual void HandleBlockPlace(wxDC *DC) override
Call after HandleBlockEnd, when a block command needs to be executed after the block is moved to its ...
static EDA_HOTKEY HkDuplicateItem(_HKI("Duplicate Symbol or Label"), HK_DUPLICATE_ITEM, 'C', ID_POPUP_SCH_DUPLICATE_ITEM)
static EDA_HOTKEY HkEdit(_HKI("Edit Item"), HK_EDIT, 'E', ID_SCH_EDIT_ITEM)
static EDA_HOTKEY HkFindNextDrcMarker(_HKI("Find Next DRC Marker"), HK_FIND_NEXT_DRC_MARKER, WXK_F5+GR_KB_SHIFT, EVT_COMMAND_FIND_DRC_MARKER)
EDA_HOTKEY * GetHotKeyDescription(int aCommand) const override
>
wxPoint m_O_Curseur
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:185
#define GR_KB_ALT
Definition: common.h:65
static EDA_HOTKEY HkResetLocalCoord(_HKI("Reset Local Coordinates"), HK_RESET_LOCAL_COORD, ' ')
static EDA_HOTKEY HkAddPower(_HKI("Add Power"), HK_ADD_NEW_POWER, 'P', ID_PLACE_POWER_BUTT)
static EDA_HOTKEY HkMove2Drag(_HKI("Move Block -> Drag Block"), HK_MOVEBLOCK_TO_DRAGBLOCK, '\t', ID_POPUP_DRAG_BLOCK)
EDA_HOTKEY * GetDescriptorFromHotkey(int aKey, EDA_HOTKEY **aList)
Function GetDescriptorFromHotkey Return a EDA_HOTKEY * pointer from a key code for OnHotKey() functio...
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Class EDA_HOTKEY_CLIENT_DATA provides client data member for hotkeys to include in command events gen...
void DisplayHotkeyList(EDA_BASE_FRAME *aFrame, struct EDA_HOTKEY_CONFIG *aDescList)
Function DisplayHotkeyList Displays the current hotkey list.
bool OnHotKey(wxDC *aDC, int aHotKey, const wxPoint &aPosition, EDA_ITEM *aItem=NULL) override
Handle hot key events.
static EDA_HOTKEY HkBeginWire(_HKI("Begin Wire"), HK_BEGIN_WIRE, 'W', ID_WIRE_BUTT)
bool HighlightConnectionAtPosition(wxPoint aPosition)
Highlight the connection found at aPosition.
bool DeleteItemAtCrossHair(wxDC *aDC)
Delete the item found under the cross hair.
Definition: schedit.cpp:643
static EDA_HOTKEY HkOrientNormalComponent(_HKI("Orient Normal Component"), HK_ORIENT_NORMAL_COMPONENT, 'N', ID_SCH_ORIENT_NORMAL)
static EDA_HOTKEY HkAddComponent(_HKI("Add Symbol"), HK_ADD_NEW_COMPONENT, 'A', ID_SCH_PLACE_COMPONENT)
static EDA_HOTKEY HkUpdatePcbFromSch(_HKI("Update PCB from Schematic"), HK_UPDATE_PCB_FROM_SCH, WXK_F8)
SCH_ITEM * GetCurItem() const
Return the currently selected SCH_ITEM, overriding BASE_SCREEN::GetCurItem().
Definition: sch_screen.h:174
#define GR_KB_SHIFT
Definition: common.h:66
static EDA_HOTKEY HkAddNoConn(_HKI("Add No Connect Flag"), HK_ADD_NOCONN_FLAG, 'Q', ID_NOCONN_BUTT)
static EDA_HOTKEY HkDrag(_HKI("Drag Item"), HK_DRAG, 'G', ID_SCH_DRAG_ITEM)
Subclass of DIALOG_SCH_FIND_BASE, which is generated by wxFormBuilder.
Class LIB_ITEM definition.
static EDA_HOTKEY HkRedo(_HKI("Redo"), HK_REDO, GR_KB_CTRL+ 'Y',(int) wxID_REDO)
static EDA_HOTKEY HkUndo(_HKI("Undo"), HK_UNDO, GR_KB_CTRL+ 'Z',(int) wxID_UNDO)
static EDA_HOTKEY HkMirrorX(_HKI("Mirror X"), HK_MIRROR_X, 'X', ID_SCH_MIRROR_X)
static EDA_HOTKEY HkFindItem(_HKI("Find Item"), HK_FIND_ITEM, 'F'+GR_KB_CTRL, ID_FIND_ITEMS)
struct EDA_HOTKEY_CONFIG g_Eeschema_Hokeys_Descr[]
static EDA_HOTKEY * common_Hotkey_List[]
static EDA_HOTKEY HkZoomRedraw(_HKI("Zoom Redraw"), HK_ZOOM_REDRAW, WXK_F3, ID_ZOOM_REDRAW)
static EDA_HOTKEY HkDeleteNode(_HKI("Delete Node"), HK_DELETE_NODE, WXK_BACK, ID_POPUP_SCH_DELETE_NODE)
static EDA_HOTKEY HkMove(_HKI("Move Schematic Item"), HK_MOVE_COMPONENT_OR_ITEM, 'M', ID_SCH_MOVE_ITEM)
static EDA_HOTKEY HkCopyBlock(_HKI("Copy Block"), HK_COPY_BLOCK, 'C'+GR_KB_CTRL, wxID_COPY)
static EDA_HOTKEY * common_basic_Hotkey_List[]
static EDA_HOTKEY HkAutoplaceFields(_HKI("Autoplace Fields"), HK_AUTOPLACE_FIELDS, 'O', ID_AUTOPLACE_FIELDS)
static EDA_HOTKEY HkInsertPin(_HKI("Repeat Pin"), HK_REPEAT_LAST, WXK_INSERT)
void SetAutoPanRequest(bool aEnable)
virtual void SetToolID(int aId, int aCursor, const wxString &aToolMsg)
Function SetToolID sets the tool command ID to aId and sets the cursor to aCursor.
Definition: draw_frame.cpp:549
static EDA_HOTKEY HkAddGraphicPolyLine(_HKI("Add Graphic PolyLine"), HK_ADD_GRAPHIC_POLYLINE, 'I', ID_LINE_COMMENT_BUTT)
static EDA_HOTKEY HkZoomOut(_HKI("Zoom Out"), HK_ZOOM_OUT, WXK_F2, ID_KEY_ZOOM_OUT)
static EDA_HOTKEY HkZoomSelection(_HKI("Zoom to Selection"), HK_ZOOM_SELECTION, '@', ID_ZOOM_SELECTION)
static EDA_HOTKEY HkAddHierarchicalLabel(_HKI("Add Hierarchical Label"), HK_ADD_HLABEL, 'H', ID_HIERLABEL_BUTT)
static EDA_HOTKEY HkEditComponentValue(_HKI("Edit Symbol Value"), HK_EDIT_COMPONENT_VALUE, 'V', ID_SCH_EDIT_COMPONENT_VALUE)
static EDA_HOTKEY * viewlib_Hotkey_List[]
static EDA_HOTKEY HkBeginBus(_HKI("Begin Bus"), HK_BEGIN_BUS, 'B', ID_BUS_BUTT)
static EDA_HOTKEY HkAddBusEntry(_HKI("Add Bus Entry"), HK_ADD_BUS_ENTRY, '/', ID_BUSTOBUS_ENTRY_BUTT)
static EDA_HOTKEY HkSaveAllLib(_HKI("Save All Libraries"), HK_SAVE_ALL_LIBS, 'S'+GR_KB_CTRL, ID_LIBEDIT_SAVE_ALL_LIBS)
static EDA_HOTKEY HkDelete(_HKI("Delete Item"), HK_DELETE, WXK_DELETE)
static EDA_HOTKEY HkLoadSchematic(_HKI("Load Schematic"), HK_LOAD_SCH, 'L'+GR_KB_CTRL)
static EDA_HOTKEY HkPasteBlock(_HKI("Paste Block"), HK_PASTE_BLOCK, 'V'+GR_KB_CTRL, wxID_PASTE)
static EDA_HOTKEY HkHighlightConnection(_HKI("Highlight Connection"), ID_HOTKEY_HIGHLIGHT, 'B'+GR_KB_CTRL)
Definition the SCH_COMPONENT class for Eeschema.
static EDA_HOTKEY HkCreatePin(_HKI("Create Pin"), HK_LIBEDIT_CREATE_PIN, 'P')
class EDA_HOTKEY is a class to handle hot key commands.
Definition: hotkeys_basic.h:57
static wxString schematicSectionTitle(_HKI("Schematic Editor"))
static EDA_HOTKEY * libEdit_Hotkey_List[]
void OnLeftDClick(wxDC *aDC, const wxPoint &aPosition) override
Function OnLeftDClick called on a double click event from the drawpanel mouse handler if an editable ...
Segment description base class to describe items which have 2 end points (track, wire, draw line ...)
Definition: sch_line.h:41
BLOCK_STATE_T GetState() const
static wxString libEditSectionTitle(_HKI("Library Editor"))
static EDA_HOTKEY HkMouseLeftDClick(_HKI("Mouse Left Double Click"), HK_LEFT_DCLICK, WXK_END, 0)
struct EDA_HOTKEY_CONFIG g_Viewlib_Hokeys_Descr[]
void OnLeftClick(wxDC *aDC, const wxPoint &aPosition) override
static EDA_HOTKEY HkFindNextItem(_HKI("Find Next Item"), HK_FIND_NEXT_ITEM, WXK_F5, wxEVT_COMMAND_FIND)
static EDA_HOTKEY HkMirrorY(_HKI("Mirror Y"), HK_MIRROR_Y, 'Y', ID_SCH_MIRROR_Y)
int GetToolId() const
Definition: draw_frame.h:476
void SetCurItem(SCH_ITEM *aItem)
Sets the currently selected object, m_CurrentItem.
Definition: sch_screen.h:182
static const KICAD_T CopyableItems[]
A scan list for schematic items that can be copied/duplicated.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:180
static EDA_HOTKEY HkZoomCenter(_HKI("Zoom Center"), HK_ZOOM_CENTER, WXK_F4, ID_POPUP_ZOOM_CENTER)
static EDA_HOTKEY HkInsert(_HKI("Repeat Last Item"), HK_REPEAT_LAST, WXK_INSERT)
static EDA_HOTKEY HkAddJunction(_HKI("Add Junction"), HK_ADD_JUNCTION, 'J', ID_JUNCTION_BUTT)
static EDA_HOTKEY HkLeaveSheet(_HKI("Leave Sheet"), HK_LEAVE_SHEET, GR_KB_ALT+WXK_BACK, ID_POPUP_SCH_LEAVE_SHEET)
Definition of class LIB_EDIT_FRAME.
static wxString libEditSectionTag(wxT("[libedit]"))
wxString g_CommonSectionTag
static EDA_HOTKEY HkEditComponentWithLibedit(_HKI("Edit with Symbol Editor"), HK_EDIT_COMPONENT_WITH_LIBEDIT, 'E'+GR_KB_CTRL, ID_POPUP_SCH_CALL_LIBEDIT_AND_LOAD_CMP)
static EDA_HOTKEY HkRotate(_HKI("Rotate Item"), HK_ROTATE, 'R', ID_SCH_ROTATE_CLOCKWISE)
static EDA_HOTKEY HkZoomAuto(_HKI("Fit on Screen"), HK_ZOOM_AUTO, WXK_HOME, ID_ZOOM_PAGE)
#define GR_KB_CTRL
Definition: common.h:64
#define _HKI(x)
static wxString commonSectionTitle(_HKI("Common"))
static EDA_HOTKEY HkCutBlock(_HKI("Cut Block"), HK_CUT_BLOCK, 'X'+GR_KB_CTRL, wxID_CUT)
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
void Process_Special_Functions(wxCommandEvent &event)
Definition: schedit.cpp:54
int m_IdMenuEvent
Definition: hotkeys_basic.h:66
static EDA_HOTKEY HkMouseLeftClick(_HKI("Mouse Left Click"), HK_LEFT_CLICK, WXK_RETURN, 0)
EDA_HOTKEY * GetDescriptorFromCommand(int aCommand, EDA_HOTKEY **aList)
Function GetDescriptorFromCommand Returns a EDA_HOTKEY* pointer from a hot key identifier.
static EDA_HOTKEY HkEditComponentReference(_HKI("Edit Symbol Reference"), HK_EDIT_COMPONENT_REFERENCE, 'U', ID_SCH_EDIT_COMPONENT_REFERENCE)
void SetCommand(BLOCK_COMMAND_T aCommand)
static EDA_HOTKEY HkAddHierSheet(_HKI("Add Sheet"), HK_ADD_HIER_SHEET, 'S', ID_SHEET_SYMBOL_BUTT)
EDA_HOTKEY * GetHotKeyDescription(int aCommand) const override
>
static EDA_HOTKEY HkAddGlobalLabel(_HKI("Add Global Label"), HK_ADD_GLABEL, GR_KB_CTRL+ 'H', ID_GLABEL_BUTT)
struct EDA_HOTKEY_CONFIG g_Schematic_Hokeys_Descr[]