|
JNGL
Easy to use cross-platform 2D game library
|
Represents a keyboard shortcut, e.g. Ctrl+S
More...
#include <jngl/KeyboardShortcut.hpp>
Public Member Functions | |
| KeyboardShortcut () | |
| No shortcut, will never trigger. | |
| KeyboardShortcut (key::KeyType modifier, char key) | |
| Modifier + key, e.g. | |
| KeyboardShortcut (key::KeyType modifier1, key::KeyType modifier2, char key) | |
| Two modifiers + key, e.g. | |
| KeyboardShortcut (key::KeyType key) | |
| Single key, e.g. jngl::key::F1. | |
| std::string | toString () const |
| Used to display the shortcut, e.g. | |
| bool | pressed () const |
| Returns true if all modifiers and the key of the shortcut was pressed in this step. | |
Represents a keyboard shortcut, e.g. Ctrl+S
Definition at line 14 of file KeyboardShortcut.hpp.
| KeyboardShortcut | ( | key::KeyType | modifier, |
| char | key ) |
Modifier + key, e.g.
{ jngl::key::Control, 's' } for Ctrl+S
| std::runtime_error | if modifier is not key::Ctrl, key::Shift or key::Alt |
| KeyboardShortcut | ( | key::KeyType | modifier1, |
| key::KeyType | modifier2, | ||
| char | key ) |
Two modifiers + key, e.g.
{ jngl::key::Control, jngl::key::Shift, 's' } for Ctrl+Shift+S
| std::runtime_error | if modifier is not key::Ctrl, key::Shift or key::Alt or if a modifier is used twice |
| std::string toString | ( | ) | const |
Used to display the shortcut, e.g.
"Ctrl+Shift+S" or "F3", returns "" for no shortcut
| bool pressed | ( | ) | const |
Returns true if all modifiers and the key of the shortcut was pressed in this step.