Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::Shortcut Struct Reference

Represents a keyboard shortcut for editor actions. More...

#include "donner/editor/TextEditor.h"

Public Member Functions

 Shortcut ()=default
 Default constructor.
 Shortcut (ImGuiKey k, ShortcutModifier m=ShortcutModifier::None)
 Constructs a shortcut with a single key and optional modifiers.
 Shortcut (ImGuiKey k1, ImGuiKey k2, ShortcutModifier m=ShortcutModifier::None)
 Constructs a shortcut with two keys and optional modifiers.
bool matches (const ImGuiIO &io) const
 Checks if this shortcut matches the current input state.

Public Attributes

ImGuiKey key1 = ImGuiKey_None
 Primary key (required).
ImGuiKey key2 = ImGuiKey_None
 Secondary key (optional).
ShortcutModifier modifiers = ShortcutModifier::None
 Combined modifiers.

Detailed Description

Represents a keyboard shortcut for editor actions.

A shortcut consists of up to two keys and optional modifier keys.

Constructor & Destructor Documentation

◆ Shortcut() [1/2]

donner::editor::Shortcut::Shortcut ( ImGuiKey k,
ShortcutModifier m = ShortcutModifier::None )
inline

Constructs a shortcut with a single key and optional modifiers.

Parameters
kPrimary key.
mModifier flags combined using bitwise OR.

◆ Shortcut() [2/2]

donner::editor::Shortcut::Shortcut ( ImGuiKey k1,
ImGuiKey k2,
ShortcutModifier m = ShortcutModifier::None )
inline

Constructs a shortcut with two keys and optional modifiers.

Parameters
k1Primary key.
k2Secondary key.
mModifier flags combined using bitwise OR.

Member Function Documentation

◆ matches()

bool donner::editor::Shortcut::matches ( const ImGuiIO & io) const
inline

Checks if this shortcut matches the current input state.

Compares the set keys and modifiers against the keys currently pressed.

Parameters
ioReference to ImGuiIO containing the current keyboard state.
Returns
true if the shortcut matches, false otherwise.

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