class

CMiriCommandSystem

Global command registry and keybind manager

Module
Miri
Header
#include "Miri/Commands/CMiriCommandSystem.h"
Namespace
Miri

Type aliases

AliasDescription
using FPersistedChordLookup = std::function<bool(const std::string& id, bool secondary, CInputChord& outChord)>Answers "has the user rebound this command?" for an id at the moment it registers: true with the chord (an invalid chord means unbound), false to keep the default. The editor installs one over its keybindings file, so commands registered after startup get their remap too.

Public functions

ReturnsNameDescription
CMiriCommandSystem&Get
voidRegisterCommandRegister a command (action bound separately via command lists).
voidSetPersistedChordLookup
boolSetAllowInTextInputMarks a registered command as allowed to dispatch while a text input has focus (see CMiriCommand::AllowInTextInput).
boolRegisterCommandRegister command + parse chord + bind the callback in the global list.
const CMiriCommand*FindCommand
const CMiriCommand*FindCommandByChordThe first of FindCommandsByChord, by command id.
std::vector<const CMiriCommand*>FindCommandsByChordEvery command bound to the chord (primary or secondary), sorted by id so resolution never depends on hash order.
boolRemapCommand
boolRemapCommand
voidResetToDefault
voidResetAllToDefaults
voidPushCommandListMost recently pushed list is consulted first
voidPopCommandList
CMiriCommandList&GetGlobalCommandListAlways-active fallback list, consulted after all pushed lists
boolHandleKeyKey-path entry point: executes the command bound to this chord.
boolExecuteCommandExecute by id: pushed lists (most specific first), then the global list
std::stringGetChordDisplayString"Ctrl+Shift+P" for the command's active chord; empty if unknown/unbound
std::vector<const CMiriCommand*>GetAllCommands

Function details

Get

C++
static CMiriCommandSystem& Get()

RegisterCommand

C++
void RegisterCommand(const CMiriCommand& command)

Register a command (action bound separately via command lists). Registering an id again (a second Details tab, an editor built on first open) keeps a remap the user already made; a first registration takes the persisted chord from the lookup when one is installed.

SetPersistedChordLookup

C++
void SetPersistedChordLookup(FPersistedChordLookup lookup)

SetAllowInTextInput

C++
bool SetAllowInTextInput(const CName& commandId, bool allow)

Marks a registered command as allowed to dispatch while a text input has focus (see CMiriCommand::AllowInTextInput). False if unknown.

RegisterCommand

C++
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

C++
const CMiriCommand* FindCommand(const CName& id) const

FindCommandByChord

C++
const CMiriCommand* FindCommandByChord(const CInputChord& chord) const

The first of FindCommandsByChord, by command id.

FindCommandsByChord

C++
std::vector<const CMiriCommand*> FindCommandsByChord(const CInputChord& chord) const

Every command bound to the chord (primary or secondary), sorted by id so resolution never depends on hash order.

RemapCommand

C++
bool RemapCommand(const CName& commandId, const CInputChord& newChord)

RemapCommand

C++
bool RemapCommand(const CName& commandId, const CInputChord& newChord, bool secondary)

ResetToDefault

C++
void ResetToDefault(const CName& commandId)

ResetAllToDefaults

C++
void ResetAllToDefaults()

PushCommandList

C++
void PushCommandList(CMiriCommandList* list)

Most recently pushed list is consulted first

PopCommandList

C++
void PopCommandList()

GetGlobalCommandList

C++
CMiriCommandList& GetGlobalCommandList()

Always-active fallback list, consulted after all pushed lists

HandleKey

C++
bool HandleKey(EKey key, EModifierKey modifiers, bool focusedIsTextInput = false)

Key-path entry point: executes the command bound to this chord. focusedIsTextInput restricts the candidates to AllowInTextInput ones.

ExecuteCommand

C++
bool ExecuteCommand(const CName& commandId)

Execute by id: pushed lists (most specific first), then the global list

GetChordDisplayString

C++
std::string GetChordDisplayString(const CName& commandId) const

"Ctrl+Shift+P" for the command's active chord; empty if unknown/unbound

GetAllCommands

C++
std::vector<const CMiriCommand*> GetAllCommands() const
Generated from Miri/Commands/CMiriCommandSystem.h via miri.json · Dec 5, 2026Version 1.1.0