KiCad PCB EDA Suite
|
Go to the source code of this file.
Macros | |
#define | EESCHEMA_HOTKEY_NAME wxT( "Eeschema" ) |
#define | PCBNEW_HOTKEY_NAME wxT( "PcbNew" ) |
#define | PSEUDO_WXK_CLICK 400 |
#define | PSEUDO_WXK_DBLCLICK 401 |
#define | PSEUDO_WXK_WHEEL 402 |
Enumerations | |
enum | HOTKEY_ACTION_TYPE { IS_HOTKEY , IS_COMMENT } |
In menus we can add a hot key, or an accelerator, or sometimes just a comment. More... | |
Functions | |
int | KeyCodeFromKeyName (const wxString &keyname) |
Return the key code from its user-friendly key name (ie: "Ctrl+M"). | |
wxString | KeyNameFromKeyCode (int aKeycode, bool *aIsFound=nullptr) |
Return the user friendly key name (ie: "Ctrl+M") from the key code. | |
wxString | AddHotkeyName (const wxString &aText, int aHotKey, HOTKEY_ACTION_TYPE aStyle=IS_HOTKEY) |
void | DisplayHotkeyList (EDA_BASE_FRAME *aFrame) |
Display the current hotkey list. | |
void | ReadHotKeyConfig (const wxString &aFileName, std::map< std::string, std::pair< int, int > > &aHotKeys) |
Reads a hotkey config file into a map. | |
void | ReadHotKeyConfigIntoActions (const wxString &aFileName, std::vector< TOOL_ACTION * > &aActions) |
Reads a hotkey config file into a list of actions. | |
int | WriteHotKeyConfig (const std::vector< TOOL_ACTION * > &aActions) |
Update the hotkeys config file with the hotkeys from the given actions map. | |
int | ReadLegacyHotkeyConfigFile (const wxString &aFilename, std::map< std::string, int > &aMap) |
Read hotkey configuration for a given app. | |
int | ReadLegacyHotkeyConfig (const wxString &aAppname, std::map< std::string, int > &aMap) |
Read configuration data and fill the current hotkey list with hotkeys. | |
#define EESCHEMA_HOTKEY_NAME wxT( "Eeschema" ) |
Definition at line 31 of file hotkeys_basic.h.
#define PCBNEW_HOTKEY_NAME wxT( "PcbNew" ) |
Definition at line 32 of file hotkeys_basic.h.
#define PSEUDO_WXK_CLICK 400 |
Definition at line 50 of file hotkeys_basic.h.
#define PSEUDO_WXK_DBLCLICK 401 |
Definition at line 51 of file hotkeys_basic.h.
#define PSEUDO_WXK_WHEEL 402 |
Definition at line 52 of file hotkeys_basic.h.
enum HOTKEY_ACTION_TYPE |
In menus we can add a hot key, or an accelerator, or sometimes just a comment.
Hot keys can perform actions using the current mouse cursor position and accelerators perform the same action as the associated menu.
A comment is used in tool tips for some tools (zoom ..) to show the hot key that performs this action
Enumerator | |
---|---|
IS_HOTKEY | |
IS_COMMENT |
Definition at line 75 of file hotkeys_basic.h.
wxString AddHotkeyName | ( | const wxString & | aText, |
int | aHotKey, | ||
HOTKEY_ACTION_TYPE | aStyle | ||
) |
aText | the base text on which to append the hotkey. |
aHotKey | the hotkey keycode. |
aStyle | IS_HOTKEY to add <tab><keyname> (shortcuts in menus, same as hotkeys). IS_COMMENT to add <spaces><(keyname)> mainly in tool tips. |
aText | the base text on which to append the hotkey. |
aHotKey | the hotkey keycode. |
aStyle | IS_HOTKEY to add <tab><keyname> (shortcuts in menus, same as hotkeys). IS_COMMENT to add <spaces><(keyname)> mainly in tool tips. |
Definition at line 238 of file hotkeys_basic.cpp.
References IS_COMMENT, IS_HOTKEY, KeyNameFromKeyCode(), MODIFIER_CMD_MAC, and MODIFIER_CTRL_BASE.
Referenced by FOOTPRINT_DIFF_WIDGET::FOOTPRINT_DIFF_WIDGET(), PCB_ONE_LAYER_SELECTOR::getLayerHotKey(), TOOL_ACTION::GetMenuItem(), PCB_LAYER_BOX_SELECTOR::Resync(), and SYMBOL_DIFF_WIDGET::SYMBOL_DIFF_WIDGET().
void DisplayHotkeyList | ( | EDA_BASE_FRAME * | aFrame | ) |
Display the current hotkey list.
aFrame | current active frame. |
aToolMgr | the tool manager holding the registered actions from which the hotkeys will be harvested. |
Definition at line 345 of file hotkeys_basic.cpp.
References DIALOG_SHIM::ShowModal().
Referenced by COMMON_CONTROL::ListHotKeys().
int KeyCodeFromKeyName | ( | const wxString & | keyname | ) |
Return the key code from its user-friendly key name (ie: "Ctrl+M").
Definition at line 279 of file hotkeys_basic.cpp.
References hotkeyNameList, KEY_NON_FOUND, hotkey_name_descr::m_KeyCode, hotkey_name_descr::m_Name, MD_ALT, MD_CTRL, MD_SHIFT, MODIFIER_ALT, MODIFIER_CMD_MAC, MODIFIER_CTRL_BASE, and MODIFIER_SHIFT.
Referenced by ReadHotKeyConfig(), ReadLegacyHotkeyConfigFile(), and WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST().
wxString KeyNameFromKeyCode | ( | int | aKeycode, |
bool * | aIsFound | ||
) |
Return the user friendly key name (ie: "Ctrl+M") from the key code.
aKeycode | key code (ASCII value, or wxWidgets value for function keys). |
aIsFound | a pointer to a bool to return true if found, or false. |
Return the user friendly key name (ie: "Ctrl+M") from the key code.
Only some wxWidgets key values are handled for function key ( see hotkeyNameList[] )
aKeycode | key code (ASCII value, or wxWidgets value for function keys). |
aIsFound | a pointer to a bool to return true if found, or false. an be nullptr default). |
Definition at line 173 of file hotkeys_basic.cpp.
References hotkeyNameList, KEY_NON_FOUND, hotkey_name_descr::m_KeyCode, hotkey_name_descr::m_Name, MD_ALT, MD_CTRL, MD_SHIFT, MODIFIER_ALT, MODIFIER_CTRL, MODIFIER_CTRL_BASE, and MODIFIER_SHIFT.
Referenced by AddHotkeyName(), APPEARANCE_CONTROLS::APPEARANCE_CONTROLS(), APPEARANCE_CONTROLS_3D::APPEARANCE_CONTROLS_3D(), WIDGET_HOTKEY_LIST::changeHotkey(), APPEARANCE_CONTROLS::createControls(), PANEL_HOTKEYS_EDITOR::dumpHotkeys(), PAD_TOOL::enterPadEditMode(), HOTKEY_FILTER::FilterMatches(), TOOL_ACTION::GetButtonTooltip(), TOOL_ACTION::GetTooltip(), ROUTER_TOOL::InlineDrag(), PANEL_GRID_SETTINGS::PANEL_GRID_SETTINGS(), ROUTER_TOOL::performDragging(), APPEARANCE_CONTROLS_3D::rebuildLayerPresetsWidget(), APPEARANCE_CONTROLS::rebuildLayerPresetsWidget(), APPEARANCE_CONTROLS::rebuildLayers(), APPEARANCE_CONTROLS::rebuildNets(), APPEARANCE_CONTROLS_3D::rebuildViewportsWidget(), APPEARANCE_CONTROLS::rebuildViewportsWidget(), WIDGET_HOTKEY_LIST::resolveKeyConflicts(), ACTION_MANAGER::RunHotKey(), PCB_CONTROL::unfilledZoneCheck(), WIDGET_HOTKEY_LIST::updateFromClientData(), and WriteHotKeyConfig().
void ReadHotKeyConfig | ( | const wxString & | aFileName, |
std::map< std::string, std::pair< int, int > > & | aHotKeys | ||
) |
Reads a hotkey config file into a map.
If aFileName is empty it will read in the default hotkeys file.
Definition at line 352 of file hotkeys_basic.cpp.
References PATHS::GetUserSettingsPath(), FILEEXT::HotkeyFileExtension, and KeyCodeFromKeyName().
Referenced by PANEL_HOTKEYS_EDITOR::ImportHotKeys(), ReadHotKeyConfigIntoActions(), ACTION_MANAGER::UpdateHotKeys(), and WriteHotKeyConfig().
void ReadHotKeyConfigIntoActions | ( | const wxString & | aFileName, |
std::vector< TOOL_ACTION * > & | aActions | ||
) |
Reads a hotkey config file into a list of actions.
If aFileName is empty it will read in the default hotkeys file.
Definition at line 393 of file hotkeys_basic.cpp.
References hotkeys, and ReadHotKeyConfig().
Referenced by DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS(), and EDA_BASE_FRAME::ShowPreferences().
int ReadLegacyHotkeyConfig | ( | const wxString & | aAppname, |
std::map< std::string, int > & | aMap | ||
) |
Read configuration data and fill the current hotkey list with hotkeys.
aAppname | the value of the app's m_FrameName. |
aMap | The list of keycodes mapped by legacy property names. |
Definition at line 441 of file hotkeys_basic.cpp.
References EESCHEMA_HOTKEY_NAME, FOOTPRINT_EDIT_FRAME_NAME, LIB_EDIT_FRAME_NAME, PCB_EDIT_FRAME_NAME, PCBNEW_HOTKEY_NAME, ReadLegacyHotkeyConfigFile(), and SCH_EDIT_FRAME_NAME.
Referenced by ACTION_MANAGER::UpdateHotKeys().
int ReadLegacyHotkeyConfigFile | ( | const wxString & | aFilename, |
std::map< std::string, int > & | aMap | ||
) |
Read hotkey configuration for a given app.
aFilename | the filename to save the hotkeys as. |
aMap | The list of keycodes mapped by legacy property names. |
Definition at line 458 of file hotkeys_basic.cpp.
References PATHS::GetUserSettingsPath(), FILEEXT::HotkeyFileExtension, and KeyCodeFromKeyName().
Referenced by ReadLegacyHotkeyConfig().
int WriteHotKeyConfig | ( | const std::vector< TOOL_ACTION * > & | aActions | ) |
Update the hotkeys config file with the hotkeys from the given actions map.
Definition at line 410 of file hotkeys_basic.cpp.
References PATHS::GetUserSettingsPath(), FILEEXT::HotkeyFileExtension, hotkeys, KeyNameFromKeyCode(), and ReadHotKeyConfig().
Referenced by PANEL_HOTKEYS_EDITOR::TransferDataFromWindow().