2011-10-19 20:32:21 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-04-16 15:26:51 +00:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2017-08-29 19:16:56 +00:00
|
|
|
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@verizon.net>
|
2019-04-14 00:44:05 +00:00
|
|
|
* Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-10-19 20:32:21 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
2019-05-06 20:37:54 +00:00
|
|
|
#include <id.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <eeschema_id.h>
|
2019-05-10 17:19:48 +00:00
|
|
|
#include <ee_hotkeys.h>
|
2018-01-30 10:49:51 +00:00
|
|
|
#include <sch_edit_frame.h>
|
2018-08-03 12:18:26 +00:00
|
|
|
#include <sch_draw_panel.h>
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <general.h>
|
2018-01-30 10:49:51 +00:00
|
|
|
#include <lib_edit_frame.h>
|
2014-10-15 11:40:38 +00:00
|
|
|
#include <viewlib_frame.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <class_libentry.h>
|
|
|
|
#include <sch_junction.h>
|
|
|
|
#include <sch_line.h>
|
|
|
|
#include <sch_component.h>
|
|
|
|
#include <sch_sheet.h>
|
2009-09-25 18:49:04 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dialogs/dialog_schematic_find.h>
|
2019-04-21 23:45:34 +00:00
|
|
|
#include <tool/tool_manager.h>
|
2019-05-10 17:19:48 +00:00
|
|
|
#include <tools/ee_selection_tool.h>
|
|
|
|
#include <tools/ee_actions.h>
|
2010-03-16 18:22:59 +00:00
|
|
|
|
2015-03-22 14:04:09 +00:00
|
|
|
// Remark: the hotkey message info is used as keyword in hotkey config files and
|
|
|
|
// as comments in help windows, therefore translated only when displayed
|
|
|
|
// they are marked _HKI to be extracted by translation tools
|
|
|
|
// See hotkeys_basic.h for more info
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-30 08:15:05 +00:00
|
|
|
/* How to add a new hotkey:
|
2009-12-02 21:44:03 +00:00
|
|
|
* add a new id in the enum hotkey_id_command like MY_NEW_ID_FUNCTION (see
|
2009-02-25 20:54:49 +00:00
|
|
|
* hotkeys.h).
|
2011-09-29 16:49:40 +00:00
|
|
|
* add a new EDA_HOTKEY entry like:
|
2015-03-22 14:04:09 +00:00
|
|
|
* static EDA_HOTKEY HkMyNewEntry(_HKI("Command Label"), MY_NEW_ID_FUNCTION,
|
2009-02-25 20:54:49 +00:00
|
|
|
* default key value);
|
2015-03-22 14:04:09 +00:00
|
|
|
* _HKI("Command Label") is the name used in hotkey list display, and the
|
2009-02-25 20:54:49 +00:00
|
|
|
* identifier in the hotkey list file
|
|
|
|
* MY_NEW_ID_FUNCTION is an equivalent id function used in the switch in
|
|
|
|
* OnHotKey() function.
|
|
|
|
* default key value is the default hotkey for this command. Can be overridden
|
|
|
|
* by the user hotkey list file
|
2014-10-15 11:40:38 +00:00
|
|
|
* add the HkMyNewEntry pointer in the schematic_Hotkey_List list or the
|
|
|
|
* libEdit_Hotkey_List list or common_Hotkey_List if the same command is
|
2011-09-30 18:15:37 +00:00
|
|
|
* added both in Eeschema and libedit)
|
2009-02-25 20:54:49 +00:00
|
|
|
* Add the new code in the switch in OnHotKey() function.
|
2010-10-30 10:03:41 +00:00
|
|
|
* when the variable itemInEdit is true, an item is currently edited.
|
2010-02-04 17:46:12 +00:00
|
|
|
* This can be useful if the new function cannot be executed while an item is
|
2009-02-25 20:54:49 +00:00
|
|
|
* currently being edited
|
|
|
|
* ( For example, one cannot start a new wire when a component is moving.)
|
|
|
|
*
|
|
|
|
* Note: If an hotkey is a special key be sure the corresponding wxWidget
|
|
|
|
* keycode (WXK_XXXX) is handled in the hotkey_name_descr
|
|
|
|
* s_Hotkey_Name_List list (see hotkeys_basic.cpp) and see this list
|
|
|
|
* for some ascii keys (space ...)
|
2007-08-30 08:15:05 +00:00
|
|
|
*
|
2007-09-19 15:29:50 +00:00
|
|
|
* Key modifier are: GR_KB_CTRL GR_KB_ALT
|
2007-08-30 08:15:05 +00:00
|
|
|
*/
|
2007-08-10 18:05:42 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2015-03-22 14:04:09 +00:00
|
|
|
// Common commands
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2013-08-03 05:15:23 +00:00
|
|
|
// Fit on Screen
|
2010-02-16 10:42:57 +00:00
|
|
|
#if !defined( __WXMAC__ )
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkZoomAuto( _HKI( "Fit on Screen" ), HK_ZOOM_AUTO, WXK_HOME );
|
2010-02-16 10:42:57 +00:00
|
|
|
#else
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkZoomAuto( _HKI( "Zoom Auto" ), HK_ZOOM_AUTO, GR_KB_CTRL + '0' );
|
2010-02-16 10:42:57 +00:00
|
|
|
#endif
|
|
|
|
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkZoomCenter( _HKI( "Zoom Center" ), HK_ZOOM_CENTER, WXK_F4 );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2013-08-03 05:15:23 +00:00
|
|
|
// Refresh Screen
|
2010-02-16 10:42:57 +00:00
|
|
|
#if !defined( __WXMAC__ )
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkZoomRedraw( _HKI( "Zoom Redraw" ), HK_ZOOM_REDRAW, WXK_F3 );
|
2010-02-16 10:42:57 +00:00
|
|
|
#else
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkZoomRedraw( _HKI( "Zoom Redraw" ), HK_ZOOM_REDRAW, GR_KB_CTRL + 'R' );
|
2010-02-16 10:42:57 +00:00
|
|
|
#endif
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2013-08-03 05:15:23 +00:00
|
|
|
// Zoom In
|
2010-01-18 19:33:45 +00:00
|
|
|
#if !defined( __WXMAC__ )
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkZoomIn( _HKI( "Zoom In" ), HK_ZOOM_IN, WXK_F1 );
|
2010-01-18 19:33:45 +00:00
|
|
|
#else
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkZoomIn( _HKI( "Zoom In" ), HK_ZOOM_IN, GR_KB_CTRL + '+' );
|
2010-01-18 19:33:45 +00:00
|
|
|
#endif
|
|
|
|
|
2013-08-03 05:15:23 +00:00
|
|
|
// Zoom Out
|
2010-01-18 19:33:45 +00:00
|
|
|
#if !defined( __WXMAC__ )
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkZoomOut( _HKI( "Zoom Out" ), HK_ZOOM_OUT, WXK_F2 );
|
2010-01-18 19:33:45 +00:00
|
|
|
#else
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkZoomOut( _HKI( "Zoom Out" ), HK_ZOOM_OUT, GR_KB_CTRL + '-' );
|
2010-01-18 19:33:45 +00:00
|
|
|
#endif
|
|
|
|
|
2019-05-13 20:42:40 +00:00
|
|
|
static EDA_HOTKEY HkSwitchUnits( _HKI( "Switch Units" ), HK_SWITCH_UNITS, 'U' + GR_KB_CTRL );
|
|
|
|
|
2019-01-02 05:12:52 +00:00
|
|
|
static EDA_HOTKEY HkHelp( _HKI( "List Hotkeys" ), HK_HELP, GR_KB_CTRL + WXK_F1 );
|
2019-05-07 12:00:06 +00:00
|
|
|
static EDA_HOTKEY HkPreferences( _HKI( "Preferences" ), HK_PREFERENCES, GR_KB_CTRL + ',',
|
|
|
|
wxID_PREFERENCES );
|
2015-03-22 14:04:09 +00:00
|
|
|
static EDA_HOTKEY HkResetLocalCoord( _HKI( "Reset Local Coordinates" ), HK_RESET_LOCAL_COORD, ' ' );
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkLeaveSheet( _HKI( "Leave Sheet" ), HK_LEAVE_SHEET, GR_KB_ALT + WXK_BACK );
|
2013-08-03 05:15:23 +00:00
|
|
|
|
2019-05-16 12:07:39 +00:00
|
|
|
static EDA_HOTKEY HkSwitchGridToNext( _HKI( "Switch Grid To Next" ),
|
|
|
|
HK_SWITCH_GRID_TO_NEXT, 'N' );
|
|
|
|
static EDA_HOTKEY HkSwitchGridToPrevious( _HKI( "Switch Grid To Previous" ),
|
|
|
|
HK_SWITCH_GRID_TO_PREVIOUS, 'N' + GR_KB_SHIFT );
|
|
|
|
|
2014-04-03 07:40:55 +00:00
|
|
|
// mouse click command:
|
2019-05-06 20:37:54 +00:00
|
|
|
static EDA_HOTKEY HkMouseLeftClick( _HKI( "Mouse Left Click" ), HK_LEFT_CLICK, WXK_RETURN,
|
|
|
|
ID_MOUSE_CLICK );
|
|
|
|
static EDA_HOTKEY HkMouseLeftDClick( _HKI( "Mouse Left Double Click" ), HK_LEFT_DCLICK, WXK_END,
|
|
|
|
ID_MOUSE_DOUBLECLICK );
|
2014-04-03 07:40:55 +00:00
|
|
|
|
2007-09-06 11:52:26 +00:00
|
|
|
// Schematic editor
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkBeginWire( _HKI( "Begin Wire" ), HK_BEGIN_WIRE, 'W' );
|
|
|
|
static EDA_HOTKEY HkBeginBus( _HKI( "Begin Bus" ), HK_BEGIN_BUS, 'B' );
|
2019-05-14 19:21:10 +00:00
|
|
|
static EDA_HOTKEY HkEndLineWireBus( _HKI( "End Line Wire Bus" ), HK_END_CURR_LINEWIREBUS, 'K' );
|
2012-10-23 16:37:19 +00:00
|
|
|
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkAddLabel( _HKI( "Add Label" ), HK_ADD_LABEL, 'L' );
|
|
|
|
static EDA_HOTKEY HkAddHierarchicalLabel( _HKI( "Add Hierarchical Label" ), HK_ADD_HLABEL, 'H' );
|
|
|
|
static EDA_HOTKEY HkAddGlobalLabel( _HKI( "Add Global Label" ), HK_ADD_GLABEL, GR_KB_CTRL + 'H' );
|
|
|
|
static EDA_HOTKEY HkAddJunction( _HKI( "Add Junction" ), HK_ADD_JUNCTION, 'J' );
|
|
|
|
static EDA_HOTKEY HkAddComponent( _HKI( "Add Symbol" ), HK_ADD_NEW_COMPONENT, 'A' );
|
|
|
|
static EDA_HOTKEY HkAddPower( _HKI( "Add Power" ), HK_ADD_NEW_POWER, 'P' );
|
|
|
|
static EDA_HOTKEY HkAddNoConn( _HKI( "Add No Connect Flag" ), HK_ADD_NOCONN_FLAG, 'Q' );
|
|
|
|
static EDA_HOTKEY HkAddHierSheet( _HKI( "Add Sheet" ), HK_ADD_HIER_SHEET, 'S' );
|
|
|
|
static EDA_HOTKEY HkAddBusEntry( _HKI( "Add Bus Entry" ), HK_ADD_BUS_ENTRY, '/' );
|
|
|
|
static EDA_HOTKEY HkAddWireEntry( _HKI( "Add Wire Entry" ), HK_ADD_WIRE_ENTRY, 'Z' );
|
|
|
|
static EDA_HOTKEY HkAddGraphicPolyLine( _HKI( "Add Graphic PolyLine" ), HK_ADD_GRAPHIC_POLYLINE, 'I' );
|
|
|
|
static EDA_HOTKEY HkAddGraphicText( _HKI( "Add Graphic Text" ), HK_ADD_GRAPHIC_TEXT, 'T' );
|
2019-05-14 19:21:10 +00:00
|
|
|
static EDA_HOTKEY HkMirrorY( _HKI( "Mirror Y" ), HK_MIRROR_Y, 'Y' );
|
|
|
|
static EDA_HOTKEY HkMirrorX( _HKI( "Mirror X" ), HK_MIRROR_X, 'X' );
|
|
|
|
static EDA_HOTKEY HkRotate( _HKI( "Rotate Item" ), HK_ROTATE, 'R' );
|
|
|
|
static EDA_HOTKEY HkEdit( _HKI( "Edit Item" ), HK_EDIT, 'E' );
|
|
|
|
static EDA_HOTKEY HkEditValue( _HKI( "Edit Symbol Value" ), HK_EDIT_COMPONENT_VALUE, 'V' );
|
|
|
|
static EDA_HOTKEY HkEditReference( _HKI( "Edit Symbol Reference" ), HK_EDIT_COMPONENT_REFERENCE, 'U' );
|
|
|
|
static EDA_HOTKEY HkEditFootprint( _HKI( "Edit Symbol Footprint" ), HK_EDIT_COMPONENT_FOOTPRINT, 'F' );
|
2019-06-01 18:36:49 +00:00
|
|
|
static EDA_HOTKEY HkShowDatasheet( _HKI( "Show Datasheet" ), HK_SHOW_DATASHEET, 'D' );
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkEditWithLibedit( _HKI( "Edit with Symbol Editor" ), HK_EDIT_COMPONENT_WITH_LIBEDIT, 'E' + GR_KB_CTRL );
|
2010-01-09 08:50:30 +00:00
|
|
|
|
2019-05-14 19:21:10 +00:00
|
|
|
static EDA_HOTKEY HkDuplicateItem( _HKI( "Duplicate" ), HK_DUPLICATE, 'D' + GR_KB_CTRL );
|
2010-01-09 08:50:30 +00:00
|
|
|
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkMove( _HKI( "Move Schematic Item" ), HK_MOVE, 'M' );
|
2019-05-14 19:21:10 +00:00
|
|
|
static EDA_HOTKEY HkDrag( _HKI( "Drag Item" ), HK_DRAG, 'G' );
|
2015-03-22 14:04:09 +00:00
|
|
|
static EDA_HOTKEY HkInsert( _HKI( "Repeat Last Item" ), HK_REPEAT_LAST, WXK_INSERT );
|
|
|
|
static EDA_HOTKEY HkDelete( _HKI( "Delete Item" ), HK_DELETE, WXK_DELETE );
|
2010-02-16 10:42:57 +00:00
|
|
|
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkFind( _HKI( "Find" ), HK_FIND, 'F' + GR_KB_CTRL );
|
|
|
|
static EDA_HOTKEY HkReplace( _HKI( "Find and Replace" ), HK_REPLACE, 'F' + GR_KB_CTRL + GR_KB_ALT );
|
|
|
|
|
2019-05-19 21:04:04 +00:00
|
|
|
static EDA_HOTKEY HkFindNextItem( _HKI( "Find Next" ), HK_FIND_NEXT, WXK_F5 );
|
|
|
|
static EDA_HOTKEY HkFindNextMarker( _HKI( "Find Next Marker" ), HK_FIND_NEXT_MARKER, WXK_F5 + GR_KB_SHIFT );
|
2019-05-07 12:00:06 +00:00
|
|
|
static EDA_HOTKEY HkZoomSelection( _HKI( "Zoom to Selection" ), HK_ZOOM_SELECTION, GR_KB_CTRL + WXK_F5,
|
|
|
|
ID_ZOOM_SELECTION );
|
2007-09-06 11:52:26 +00:00
|
|
|
|
2010-02-04 17:46:12 +00:00
|
|
|
// Special keys for library editor:
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkCreatePin( _HKI( "Create Pin" ), HK_LIBEDIT_CREATE_PIN, 'P' );
|
2015-03-22 14:04:09 +00:00
|
|
|
static EDA_HOTKEY HkInsertPin( _HKI( "Repeat Pin" ), HK_REPEAT_LAST, WXK_INSERT );
|
2007-09-06 11:52:26 +00:00
|
|
|
|
2015-12-13 16:56:47 +00:00
|
|
|
// Autoplace fields
|
2019-05-14 19:21:10 +00:00
|
|
|
static EDA_HOTKEY HkAutoplaceFields( _HKI( "Autoplace Fields" ), HK_AUTOPLACE_FIELDS, 'O' );
|
2015-12-13 16:56:47 +00:00
|
|
|
|
2019-06-01 15:28:39 +00:00
|
|
|
static EDA_HOTKEY HkUpdatePcbFromSch( _HKI( "Update PCB from Schematic" ), HK_UPDATE_PCB_FROM_SCH, WXK_F8 );
|
2016-01-29 10:24:39 +00:00
|
|
|
|
2019-04-30 13:54:32 +00:00
|
|
|
// Selection
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkSelectNode( _HKI( "Select Node" ), HK_SELECT_NODE, GR_KB_ALT + '3' );
|
|
|
|
static EDA_HOTKEY HkSelectConnection( _HKI( "Select Connection" ), HK_SELECT_CONNECTION, GR_KB_ALT + '4' );
|
2019-04-30 13:54:32 +00:00
|
|
|
|
2016-11-16 12:09:34 +00:00
|
|
|
// Higtlight connection
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkHighlightConnection( _HKI( "Highlight Net" ), ID_HOTKEY_HIGHLIGHT, 'B' + GR_KB_CTRL );
|
2016-11-16 12:09:34 +00:00
|
|
|
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkUnfoldBus( _HKI( "Unfold from Bus" ), HK_UNFOLD_BUS, 'C', ID_SCH_UNFOLD_BUS );
|
2019-03-11 21:32:05 +00:00
|
|
|
|
2018-02-22 19:05:10 +00:00
|
|
|
// Common: hotkeys_basic.h
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkNew( _HKI( "New" ), HK_NEW, GR_KB_CTRL + 'N', wxID_NEW );
|
|
|
|
static EDA_HOTKEY HkOpen( _HKI( "Open" ), HK_OPEN, GR_KB_CTRL + 'O', wxID_OPEN );
|
|
|
|
static EDA_HOTKEY HkSave( _HKI( "Save" ), HK_SAVE, GR_KB_CTRL + 'S', wxID_SAVE );
|
|
|
|
static EDA_HOTKEY HkSaveAs( _HKI( "Save As" ), HK_SAVEAS, GR_KB_SHIFTCTRL + 'S', wxID_SAVEAS );
|
|
|
|
static EDA_HOTKEY HkPrint( _HKI( "Print" ), HK_PRINT, GR_KB_CTRL + 'P', wxID_PRINT );
|
|
|
|
|
|
|
|
static EDA_HOTKEY HkUndo( _HKI( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z' );
|
2018-02-22 19:05:10 +00:00
|
|
|
|
|
|
|
#if !defined( __WXMAC__ )
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y' );
|
2018-02-22 19:05:10 +00:00
|
|
|
#else
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkRedo( _HKI( "Redo" ), HK_REDO, GR_KB_SHIFTCTRL + 'Z' );
|
2018-02-22 19:05:10 +00:00
|
|
|
#endif
|
|
|
|
|
2019-05-15 22:49:48 +00:00
|
|
|
static EDA_HOTKEY HkCut( _HKI( "Cut" ), HK_CUT, GR_KB_CTRL + 'X' );
|
|
|
|
static EDA_HOTKEY HkCopy( _HKI( "Copy" ), HK_COPY, GR_KB_CTRL + 'C' );
|
|
|
|
static EDA_HOTKEY HkPaste( _HKI( "Paste" ), HK_PASTE, GR_KB_CTRL + 'V' );
|
2018-02-22 19:05:10 +00:00
|
|
|
|
2018-09-10 13:37:28 +00:00
|
|
|
static EDA_HOTKEY HkCanvasOpenGL( _HKI( "Switch to Modern Toolset with hardware-accelerated graphics (recommended)" ),
|
|
|
|
HK_CANVAS_OPENGL,
|
|
|
|
#ifdef __WXMAC__
|
|
|
|
GR_KB_ALT +
|
|
|
|
#endif
|
|
|
|
WXK_F11, ID_MENU_CANVAS_OPENGL );
|
|
|
|
static EDA_HOTKEY HkCanvasCairo( _HKI( "Switch to Modern Toolset with software graphics (fall-back)" ),
|
|
|
|
HK_CANVAS_CAIRO,
|
|
|
|
#ifdef __WXMAC__
|
|
|
|
GR_KB_ALT +
|
|
|
|
#endif
|
|
|
|
WXK_F12, ID_MENU_CANVAS_CAIRO );
|
2018-02-22 19:05:10 +00:00
|
|
|
|
2007-09-06 11:52:26 +00:00
|
|
|
// List of common hotkey descriptors
|
2014-10-15 11:40:38 +00:00
|
|
|
static EDA_HOTKEY* common_Hotkey_List[] =
|
2007-09-06 11:52:26 +00:00
|
|
|
{
|
2018-02-22 19:05:10 +00:00
|
|
|
&HkNew, &HkOpen, &HkSave, &HkSaveAs, &HkPrint,
|
|
|
|
&HkUndo, &HkRedo,
|
2019-05-15 22:49:48 +00:00
|
|
|
&HkCut, &HkCopy, &HkPaste,
|
|
|
|
&HkFind, &HkReplace,
|
2007-09-06 11:52:26 +00:00
|
|
|
&HkHelp,
|
2019-04-01 17:18:29 +00:00
|
|
|
&HkPreferences,
|
2010-02-04 17:46:12 +00:00
|
|
|
&HkZoomIn,
|
|
|
|
&HkZoomOut,
|
|
|
|
&HkZoomRedraw,
|
|
|
|
&HkZoomCenter,
|
|
|
|
&HkZoomAuto,
|
2016-06-08 11:19:53 +00:00
|
|
|
&HkZoomSelection,
|
2019-05-14 19:21:10 +00:00
|
|
|
&HkSwitchUnits,
|
2007-09-06 11:52:26 +00:00
|
|
|
&HkResetLocalCoord,
|
2019-05-16 12:07:39 +00:00
|
|
|
&HkSwitchGridToNext,
|
|
|
|
&HkSwitchGridToPrevious,
|
2013-05-28 09:49:53 +00:00
|
|
|
&HkEdit,
|
2019-05-08 18:56:03 +00:00
|
|
|
&HkDuplicateItem,
|
2013-05-28 09:49:53 +00:00
|
|
|
&HkDelete,
|
|
|
|
&HkRotate,
|
|
|
|
&HkDrag,
|
2019-05-08 18:56:03 +00:00
|
|
|
&HkMove,
|
|
|
|
&HkMirrorX,
|
|
|
|
&HkMirrorY,
|
2014-04-03 07:40:55 +00:00
|
|
|
&HkMouseLeftClick,
|
|
|
|
&HkMouseLeftDClick,
|
2007-09-06 11:52:26 +00:00
|
|
|
NULL
|
|
|
|
};
|
2007-08-10 18:05:42 +00:00
|
|
|
|
2019-04-30 13:54:32 +00:00
|
|
|
// List of common hotkey descriptors, for the library viewer
|
2014-10-15 11:40:38 +00:00
|
|
|
static EDA_HOTKEY* common_basic_Hotkey_List[] =
|
|
|
|
{
|
2019-05-15 22:49:48 +00:00
|
|
|
&HkCut, &HkCopy, &HkPaste,
|
2014-10-15 11:40:38 +00:00
|
|
|
&HkHelp,
|
|
|
|
&HkZoomIn,
|
|
|
|
&HkZoomOut,
|
|
|
|
&HkZoomRedraw,
|
|
|
|
&HkZoomCenter,
|
|
|
|
&HkZoomAuto,
|
|
|
|
&HkResetLocalCoord,
|
2019-05-08 18:56:03 +00:00
|
|
|
&HkEdit,
|
|
|
|
&HkDuplicateItem,
|
|
|
|
&HkDelete,
|
|
|
|
&HkRotate,
|
|
|
|
&HkMove,
|
|
|
|
&HkMirrorX,
|
|
|
|
&HkMirrorY,
|
2014-10-15 11:40:38 +00:00
|
|
|
&HkMouseLeftClick,
|
|
|
|
&HkMouseLeftDClick,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2007-08-10 18:05:42 +00:00
|
|
|
// List of hotkey descriptors for schematic
|
2014-10-15 11:40:38 +00:00
|
|
|
static EDA_HOTKEY* schematic_Hotkey_List[] =
|
2009-02-25 20:54:49 +00:00
|
|
|
{
|
2010-03-16 18:22:59 +00:00
|
|
|
&HkFindNextItem,
|
2019-05-07 12:00:06 +00:00
|
|
|
&HkFindNextMarker,
|
2010-02-04 17:46:12 +00:00
|
|
|
&HkInsert,
|
|
|
|
&HkAddComponent,
|
2010-11-11 17:54:24 +00:00
|
|
|
&HkAddPower,
|
2019-05-07 12:00:06 +00:00
|
|
|
&HkEditValue,
|
|
|
|
&HkEditReference,
|
|
|
|
&HkEditFootprint,
|
|
|
|
&HkShowDatasheet,
|
|
|
|
&HkEditWithLibedit,
|
2019-04-30 13:54:32 +00:00
|
|
|
&HkSelectNode,
|
|
|
|
&HkSelectConnection,
|
2007-08-30 08:15:05 +00:00
|
|
|
&HkBeginWire,
|
2010-11-11 17:54:24 +00:00
|
|
|
&HkBeginBus,
|
2012-10-23 16:37:19 +00:00
|
|
|
&HkEndLineWireBus,
|
2010-07-15 14:18:11 +00:00
|
|
|
&HkAddLabel,
|
2010-11-11 17:54:24 +00:00
|
|
|
&HkAddHierarchicalLabel,
|
|
|
|
&HkAddGlobalLabel,
|
2010-10-30 10:03:41 +00:00
|
|
|
&HkAddJunction,
|
2010-07-26 17:06:36 +00:00
|
|
|
&HkAddNoConn,
|
2010-11-11 17:54:24 +00:00
|
|
|
&HkAddHierSheet,
|
|
|
|
&HkAddWireEntry,
|
|
|
|
&HkAddBusEntry,
|
|
|
|
&HkAddGraphicPolyLine,
|
|
|
|
&HkAddGraphicText,
|
2016-01-29 10:24:39 +00:00
|
|
|
&HkUpdatePcbFromSch,
|
2015-12-13 16:56:47 +00:00
|
|
|
&HkAutoplaceFields,
|
2016-01-29 14:43:40 +00:00
|
|
|
&HkLeaveSheet,
|
2016-11-16 12:09:34 +00:00
|
|
|
&HkHighlightConnection,
|
2019-03-11 21:32:05 +00:00
|
|
|
&HkUnfoldBus,
|
2018-09-10 13:37:28 +00:00
|
|
|
&HkCanvasCairo,
|
|
|
|
&HkCanvasOpenGL,
|
2007-08-30 08:15:05 +00:00
|
|
|
NULL
|
2007-08-10 18:05:42 +00:00
|
|
|
};
|
|
|
|
|
2009-12-02 21:44:03 +00:00
|
|
|
// List of hotkey descriptors for library editor
|
2014-10-15 11:40:38 +00:00
|
|
|
static EDA_HOTKEY* libEdit_Hotkey_List[] =
|
2007-08-10 18:05:42 +00:00
|
|
|
{
|
2010-07-26 17:06:36 +00:00
|
|
|
&HkCreatePin,
|
2007-08-30 08:15:05 +00:00
|
|
|
&HkInsertPin,
|
2019-06-01 18:36:49 +00:00
|
|
|
&HkShowDatasheet,
|
2007-08-30 08:15:05 +00:00
|
|
|
NULL
|
2007-08-10 18:05:42 +00:00
|
|
|
};
|
|
|
|
|
2019-06-01 18:36:49 +00:00
|
|
|
// List of hotkey descriptors for library viewer (currently empty)
|
2014-10-15 11:40:38 +00:00
|
|
|
static EDA_HOTKEY* viewlib_Hotkey_List[] =
|
|
|
|
{
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2015-04-16 15:26:51 +00:00
|
|
|
// Keyword Identifiers (tags) in key code configuration file (section names)
|
|
|
|
// (.m_SectionTag member of a EDA_HOTKEY_CONFIG)
|
|
|
|
static wxString schematicSectionTag( wxT( "[eeschema]" ) );
|
|
|
|
static wxString libEditSectionTag( wxT( "[libedit]" ) );
|
|
|
|
|
|
|
|
// Titles for hotkey editor and hotkey display
|
|
|
|
static wxString commonSectionTitle( _HKI( "Common" ) );
|
|
|
|
static wxString schematicSectionTitle( _HKI( "Schematic Editor" ) );
|
|
|
|
static wxString libEditSectionTitle( _HKI( "Library Editor" ) );
|
|
|
|
|
2011-09-30 18:15:37 +00:00
|
|
|
// list of sections and corresponding hotkey list for Eeschema (used to create
|
2009-02-25 20:54:49 +00:00
|
|
|
// an hotkey config file)
|
2019-04-01 17:14:16 +00:00
|
|
|
struct EDA_HOTKEY_CONFIG g_Eeschema_Hotkeys_Descr[] =
|
2007-09-10 04:51:01 +00:00
|
|
|
{
|
2015-04-16 15:26:51 +00:00
|
|
|
{ &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
|
|
|
|
{ &schematicSectionTag, schematic_Hotkey_List, &schematicSectionTitle },
|
2015-04-19 11:07:31 +00:00
|
|
|
{ &libEditSectionTag, libEdit_Hotkey_List, &libEditSectionTitle },
|
|
|
|
{ NULL, NULL, NULL }
|
2007-09-06 11:52:26 +00:00
|
|
|
};
|
|
|
|
|
2009-02-25 20:54:49 +00:00
|
|
|
// list of sections and corresponding hotkey list for the schematic editor
|
|
|
|
// (used to list current hotkeys)
|
2019-04-01 17:14:16 +00:00
|
|
|
struct EDA_HOTKEY_CONFIG g_Schematic_Hotkeys_Descr[] =
|
2007-09-10 04:51:01 +00:00
|
|
|
{
|
2015-04-19 11:07:31 +00:00
|
|
|
{ &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
|
2015-11-04 08:48:34 +00:00
|
|
|
{ &schematicSectionTag, schematic_Hotkey_List, &schematicSectionTitle },
|
2015-04-16 15:26:51 +00:00
|
|
|
{ NULL, NULL, NULL }
|
2007-09-06 11:52:26 +00:00
|
|
|
};
|
|
|
|
|
2009-02-25 20:54:49 +00:00
|
|
|
// list of sections and corresponding hotkey list for the component editor
|
|
|
|
// (used to list current hotkeys)
|
2019-04-01 17:14:16 +00:00
|
|
|
struct EDA_HOTKEY_CONFIG g_Libedit_Hotkeys_Descr[] =
|
2007-09-10 04:51:01 +00:00
|
|
|
{
|
2015-04-19 11:07:31 +00:00
|
|
|
{ &g_CommonSectionTag, common_Hotkey_List, &commonSectionTitle },
|
|
|
|
{ &libEditSectionTag, libEdit_Hotkey_List, &libEditSectionTitle },
|
2015-04-16 15:26:51 +00:00
|
|
|
{ NULL, NULL, NULL }
|
2007-09-06 11:52:26 +00:00
|
|
|
};
|
|
|
|
|
2009-09-27 14:09:26 +00:00
|
|
|
// list of sections and corresponding hotkey list for the component browser
|
|
|
|
// (used to list current hotkeys)
|
2019-04-01 17:14:16 +00:00
|
|
|
struct EDA_HOTKEY_CONFIG g_Viewlib_Hotkeys_Descr[] =
|
2009-09-27 14:09:26 +00:00
|
|
|
{
|
2015-04-16 15:26:51 +00:00
|
|
|
{ &g_CommonSectionTag, common_basic_Hotkey_List, &commonSectionTitle },
|
2014-10-16 01:17:46 +00:00
|
|
|
{ NULL, NULL, NULL }
|
2009-09-27 14:09:26 +00:00
|
|
|
};
|
|
|
|
|
2015-05-05 18:39:42 +00:00
|
|
|
|
|
|
|
EDA_HOTKEY* SCH_EDIT_FRAME::GetHotKeyDescription( int aCommand ) const
|
|
|
|
{
|
|
|
|
EDA_HOTKEY* HK_Descr = GetDescriptorFromCommand( aCommand, common_Hotkey_List );
|
|
|
|
|
|
|
|
if( HK_Descr == NULL )
|
|
|
|
HK_Descr = GetDescriptorFromCommand( aCommand, schematic_Hotkey_List );
|
|
|
|
|
|
|
|
return HK_Descr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
EDA_HOTKEY* LIB_EDIT_FRAME::GetHotKeyDescription( int aCommand ) const
|
|
|
|
{
|
|
|
|
EDA_HOTKEY* HK_Descr = GetDescriptorFromCommand( aCommand, common_Hotkey_List );
|
|
|
|
|
|
|
|
if( HK_Descr == NULL )
|
|
|
|
HK_Descr = GetDescriptorFromCommand( aCommand, libEdit_Hotkey_List );
|
|
|
|
|
|
|
|
return HK_Descr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
EDA_HOTKEY* LIB_VIEW_FRAME::GetHotKeyDescription( int aCommand ) const
|
|
|
|
{
|
|
|
|
EDA_HOTKEY* HK_Descr = GetDescriptorFromCommand( aCommand, common_Hotkey_List );
|
|
|
|
|
|
|
|
if( HK_Descr == NULL )
|
|
|
|
HK_Descr = GetDescriptorFromCommand( aCommand, viewlib_Hotkey_List );
|
|
|
|
|
|
|
|
return HK_Descr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|