KiCad PCB EDA Suite
Loading...
Searching...
No Matches
HOTKEY_STORE Class Reference

A class that contains a set of hotkeys, arranged into "sections" and provides some book-keeping functions for them. More...

#include <hotkey_store.h>

Public Member Functions

 HOTKEY_STORE ()
 Construct a HOTKEY_STORE from a list of hotkey sections.
 
void Init (std::vector< TOOL_ACTION * > aActionsList, bool aIncludeReadOnlyCmds)
 
std::vector< HOTKEY_SECTION > & GetSections ()
 Get the list of sections managed by this store.
 
void SaveAllHotkeys ()
 Persist all changes to hotkeys in the store to the underlying data structures.
 
void ResetAllHotkeysToDefault ()
 Reset every hotkey in the store to the default values.
 
void ResetAllHotkeysToOriginal ()
 Resets every hotkey to the original values.
 
bool CheckKeyConflicts (TOOL_ACTION *aAction, long aKey, HOTKEY **aConflict)
 Check whether the given key conflicts with anything in this store.
 

Static Public Member Functions

static wxString GetAppName (TOOL_ACTION *aAction)
 
static wxString GetSectionName (TOOL_ACTION *aAction)
 

Private Attributes

std::vector< TOOL_MANAGER * > m_toolManagers
 
std::vector< HOTKEY_SECTIONm_hk_sections
 

Detailed Description

A class that contains a set of hotkeys, arranged into "sections" and provides some book-keeping functions for them.

Definition at line 65 of file hotkey_store.h.

Constructor & Destructor Documentation

◆ HOTKEY_STORE()

HOTKEY_STORE::HOTKEY_STORE ( )

Construct a HOTKEY_STORE from a list of hotkey sections.

Parameters
aHotkeysthe hotkey configs that will be managed by this store.

Definition at line 93 of file hotkey_store.cpp.

Member Function Documentation

◆ CheckKeyConflicts()

bool HOTKEY_STORE::CheckKeyConflicts ( TOOL_ACTION aAction,
long  aKey,
HOTKEY **  aConflict 
)

Check whether the given key conflicts with anything in this store.

Parameters
aAction- the action the key is proposed to be assigned to. Only conflicts within the same section will be flagged.
aKey- key to check
aConflict- outparam getting the section this one conflicts with

Definition at line 212 of file hotkey_store.cpp.

References AS_CONTEXT, AS_GLOBAL, TOOL_ACTION::GetScope(), GetSectionName(), TOOL_ACTION::GetToolName(), HOTKEY::m_Actions, HOTKEY::m_EditKeycode, HOTKEY::m_EditKeycodeAlt, and m_hk_sections.

Referenced by WIDGET_HOTKEY_LIST::resolveKeyConflicts().

◆ GetAppName()

wxString HOTKEY_STORE::GetAppName ( TOOL_ACTION aAction)
static

Definition at line 65 of file hotkey_store.cpp.

References TOOL_ACTION::GetName(), and name.

Referenced by GetSectionName(), and Init().

◆ GetSectionName()

wxString HOTKEY_STORE::GetSectionName ( TOOL_ACTION aAction)
static

Definition at line 72 of file hotkey_store.cpp.

References _, and GetAppName().

Referenced by CheckKeyConflicts(), Init(), and WIDGET_HOTKEY_LIST::resolveKeyConflicts().

◆ GetSections()

std::vector< HOTKEY_SECTION > & HOTKEY_STORE::GetSections ( )

Get the list of sections managed by this store.

Definition at line 167 of file hotkey_store.cpp.

References m_hk_sections.

Referenced by PANEL_HOTKEYS_EDITOR::dumpHotkeys(), PANEL_HOTKEYS_EDITOR::ImportHotKeys(), and WIDGET_HOTKEY_LIST::updateShownItems().

◆ Init()

◆ ResetAllHotkeysToDefault()

void HOTKEY_STORE::ResetAllHotkeysToDefault ( )

Reset every hotkey in the store to the default values.

Definition at line 186 of file hotkey_store.cpp.

References HOTKEY::m_Actions, HOTKEY::m_EditKeycode, HOTKEY::m_EditKeycodeAlt, and m_hk_sections.

Referenced by WIDGET_HOTKEY_LIST::ResetAllHotkeys().

◆ ResetAllHotkeysToOriginal()

void HOTKEY_STORE::ResetAllHotkeysToOriginal ( )

Resets every hotkey to the original values.

Definition at line 199 of file hotkey_store.cpp.

References HOTKEY::m_Actions, HOTKEY::m_EditKeycode, HOTKEY::m_EditKeycodeAlt, and m_hk_sections.

Referenced by WIDGET_HOTKEY_LIST::ResetAllHotkeys().

◆ SaveAllHotkeys()

void HOTKEY_STORE::SaveAllHotkeys ( )

Persist all changes to hotkeys in the store to the underlying data structures.

Definition at line 173 of file hotkey_store.cpp.

References HOTKEY::m_Actions, HOTKEY::m_EditKeycode, HOTKEY::m_EditKeycodeAlt, m_hk_sections, and TOOL_ACTION::SetHotKey().

Referenced by WIDGET_HOTKEY_LIST::TransferDataFromControl().

Member Data Documentation

◆ m_hk_sections

std::vector<HOTKEY_SECTION> HOTKEY_STORE::m_hk_sections
private

◆ m_toolManagers

std::vector<TOOL_MANAGER*> HOTKEY_STORE::m_toolManagers
private

Definition at line 113 of file hotkey_store.h.


The documentation for this class was generated from the following files: