CArcCommandSystem
Global command registry and keybind manager
- Module
- Arc
- Header
#include "Arc/Commands/CArcCommandSystem.h"- Namespace
Arcf
Public functions
| Returns | Name | Description |
|---|---|---|
CArcCommandSystem& | Get | |
void | RegisterCommand | Register a command (action bound separately via command lists) |
bool | RegisterCommand | Register command + parse chord + bind the callback in the global list. |
const CArcUICommand* | FindCommand | |
const CArcUICommand* | FindCommandByChord | The first of FindCommandsByChord, by command id. |
std::vector<const CArcUICommand*> | FindCommandsByChord | Every command bound to the chord (primary or secondary), sorted by id so resolution never depends on hash order. |
bool | RemapCommand | |
bool | RemapCommand | |
void | ResetToDefault | |
void | ResetAllToDefaults | |
void | PushCommandList | Most recently pushed list is consulted first |
void | PopCommandList | |
CArcCommandList& | GetGlobalCommandList | Always-active fallback list, consulted after all pushed lists |
bool | HandleKey | Key-path entry point: executes the command bound to this chord |
bool | ExecuteCommand | Execute by id: pushed lists (most specific first), then the global list |
std::string | GetChordDisplayString | "Ctrl+Shift+P" for the command's active chord; empty if unknown/unbound |
std::vector<const CArcUICommand*> | GetAllCommands |
Function details
Get
static CArcCommandSystem& Get()RegisterCommand
void RegisterCommand(const CArcUICommand& command)Register a command (action bound separately via command lists)
RegisterCommand
bool RegisterCommand(const std::string& id, const std::string& chord, std::function<void()> callback, const std::string& label = std::string())Register command + parse chord + bind the callback in the global list. Returns false (and registers nothing) if the chord string does not parse; an empty chord string registers a command with no keybind.
FindCommand
const CArcUICommand* FindCommand(const CName& id) constFindCommandByChord
const CArcUICommand* FindCommandByChord(const CInputChord& chord) constThe first of FindCommandsByChord, by command id.
FindCommandsByChord
std::vector<const CArcUICommand*> FindCommandsByChord(const CInputChord& chord) constEvery command bound to the chord (primary or secondary), sorted by id so resolution never depends on hash order.
RemapCommand
bool RemapCommand(const CName& commandId, const CInputChord& newChord)RemapCommand
bool RemapCommand(const CName& commandId, const CInputChord& newChord, bool secondary)ResetToDefault
void ResetToDefault(const CName& commandId)ResetAllToDefaults
void ResetAllToDefaults()PushCommandList
void PushCommandList(CArcCommandList* list)Most recently pushed list is consulted first
PopCommandList
void PopCommandList()GetGlobalCommandList
CArcCommandList& GetGlobalCommandList()Always-active fallback list, consulted after all pushed lists
HandleKey
bool HandleKey(EKey key, EModifierKey modifiers)Key-path entry point: executes the command bound to this chord
ExecuteCommand
bool ExecuteCommand(const CName& commandId)Execute by id: pushed lists (most specific first), then the global list
GetChordDisplayString
std::string GetChordDisplayString(const CName& commandId) const"Ctrl+Shift+P" for the command's active chord; empty if unknown/unbound
GetAllCommands
std::vector<const CArcUICommand*> GetAllCommands() const