Accelerator
Keyboard shortcut.
| Header | #include "nativeui/accelerator.h" |
| Namespace | namespace nu |
| Type | class |
Accelerators are represented by strings that contain multiple modifier and
key codes, combined by the + character.
Examples:
CmdOrCtrl+AShift+Backspace
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
Control,CtrlCommandOrControl,CmdOrCtrlAlt,OptionShiftMeta,Command,Super
Available key codes
0to9AtoZF1toF24- Punctuations like
~,!,@,#,$, etc. Enter,ReturnEsc,EscapeUp,Down,Left,RightHome,EndPageDown,PageUpArrowDown,ArrowLeft,ArrowRight,ArrowUpAudioVolumeDown,AudioVolumeMute,AudioVolumeUpBrowserBack,BrowserFavorites,BrowserForward,BrowserHome,BrowserRefresh,BrowserSearch,BrowserStopLaunchApplication1,LaunchApplication2,LaunchMail,LaunchMediaplayerMediaPlayPause,MediaStop,MediaTrackNext,MediaTrackPreviousHangulMode,HanjaMode,KanaMode,KanjiModeAddBackspaceCancelCapsLockClearContextmenuDecimalDeleteDivideExecuteHelpInsertMultiplyNumlockPausePlusPrintScrolllockSelectSnapshotSpaceSubtractTab
Constructors
Accelerator()
Create an empty accelerator.
Accelerator(const KeyEvent& event)
Create from the key event.
Parameters
const KeyEvent&event
Accelerator(const std::string& description)
Create from string description.
Parameters
const std::string&description
Methods
KeyboardCode GetKeyCode() const
Return the key code.
Return
KeyboardCodeint GetModifiers() const
Return the modifiers.
Return
int