KeyUtils

AppCUI::Utils::KeyUtils (class)

class KeyUtils

Public Static Functions

static string_view GetKeyName(Input::Key keyCode)

Returns the name of the Key without modifiers.

static string_view GetKeyModifierName(Input::Key keyCode)
static string_view GetKeyNamePadded(Input::Key keyCode)
static bool ToString(Input::Key keyCode, char *text, uint32 maxTextSize)
static bool ToString(Input::Key keyCode, Utils::String &text)
static Input::Key FromString(string_view stringRepresentation)
static Input::Key KeyModifiersFromString(string_view stringRepresentation)
static string_view GetKeyModifierDisplayName(Input::Key keyCode)

Display helpers: map the logical key to the physical key the user presses (see Input::ModifierMap) and use platform modifier names (e.g.

“Opt+” for Alt on macOS). ToString stays canonical (serialization).

static bool ToDisplayString(Input::Key keyCode, Utils::String &text)
static bool ToDisplayString(Input::Key keyCode, const Input::ModifierMap &map, Utils::String &text)

same as ToDisplayString but with an explicit modifier profile (e.g. to preview a profile before applying it)

static Input::Key CreateHotKey(char16 hotKey, Input::Key modifier = Input::Key::None)

Public Static Attributes

static constexpr const uint32 KEY_SHIFT_MASK = 0x7000
static constexpr const uint32 KEY_SHIFT_BITS = 12
static constexpr const uint32 KEY_CODE_MASK = 0xFF