Accelerator

Keyboard shortcut.

Header#include "nativeui/accelerator.h"
Namespacenamespace nu
Typeclass

Accelerators are represented by strings that contain multiple modifier and key codes, combined by the + character.

Examples:

Platform-dependent modifiers

On Linux and Window, the CommandOrControl modifier is mapped to the Control key. On macOS it is mapped to the Command key. This is useful when defining some common keyboard shortcuts.

Available modifiers

Available key codes

Constructors

Accelerator()

Create an empty accelerator.

Accelerator(const KeyEvent& event)

Create from the key event.

Parameters

Accelerator(const std::string& description)

Create from string description.

Parameters

Methods

KeyboardCode GetKeyCode() const

Return the key code.

Return

KeyboardCode

int GetModifiers() const

Return the modifiers.

Return

int