TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::CommandManager::Command Struct Reference

A registered command. More...

#include <gui_core/input/gui_command_manager.h>

Public Member Functions

bool IsChord () const
bool HasShortcut () const
bool IsHeld () const
bool IsRebound () const
 True when its shortcut isn't the one it was registered with.

Public Attributes

CommandMode mode
IconID icon = IconID::Invalid
 optional
KeyCode key
KeyModifier modifiers
KeyCode chord2Key = KeyCode::None
 Second key of a 2-key chord (e.g. Ctrl+K then Ctrl+S); None = single-key.
KeyModifier chord2Mods = KeyModifier::None
std::string description
std::string displayString
 cached "Ctrl+Shift+D" or "Ctrl+K Ctrl+S"
KeyCode defaultKey = KeyCode::None
 The shortcut it was registered with (the first key, for a chord).
KeyModifier defaultModifiers = KeyModifier::None
std::function< void()> callback
 Instant: callback fires on press, onEnd is empty.
std::function< void()> onEnd
 Instant: callback fires on press, onEnd is empty.

Detailed Description

A registered command.

Member Function Documentation

◆ IsChord()

bool tachyon::CommandManager::Command::IsChord ( ) const
inline

◆ HasShortcut()

bool tachyon::CommandManager::Command::HasShortcut ( ) const
inline

◆ IsHeld()

bool tachyon::CommandManager::Command::IsHeld ( ) const
inline

◆ IsRebound()

bool tachyon::CommandManager::Command::IsRebound ( ) const
inline

True when its shortcut isn't the one it was registered with.

Member Data Documentation

◆ mode

CommandMode tachyon::CommandManager::Command::mode

◆ icon

IconID tachyon::CommandManager::Command::icon = IconID::Invalid

optional

◆ key

KeyCode tachyon::CommandManager::Command::key

◆ modifiers

KeyModifier tachyon::CommandManager::Command::modifiers

◆ chord2Key

KeyCode tachyon::CommandManager::Command::chord2Key = KeyCode::None

Second key of a 2-key chord (e.g. Ctrl+K then Ctrl+S); None = single-key.

◆ chord2Mods

KeyModifier tachyon::CommandManager::Command::chord2Mods = KeyModifier::None

◆ description

std::string tachyon::CommandManager::Command::description

◆ displayString

std::string tachyon::CommandManager::Command::displayString

cached "Ctrl+Shift+D" or "Ctrl+K Ctrl+S"

◆ callback

std::function<void()> tachyon::CommandManager::Command::callback

Instant: callback fires on press, onEnd is empty.

Held (RegisterHeldCommand): callback on press, onEnd on release.

◆ onEnd

std::function<void()> tachyon::CommandManager::Command::onEnd

Instant: callback fires on press, onEnd is empty.

Held (RegisterHeldCommand): callback on press, onEnd on release.

◆ defaultKey

KeyCode tachyon::CommandManager::Command::defaultKey = KeyCode::None

The shortcut it was registered with (the first key, for a chord).

◆ defaultModifiers

KeyModifier tachyon::CommandManager::Command::defaultModifiers = KeyModifier::None

The documentation for this struct was generated from the following file: