![]() |
Gorgon Game Engine
|
This class represents a modifier key. These keys can be. More...
Public Types | |
enum | Type { None, Shift, Ctrl, Alt, Meta, ShiftCtrl, ShiftAlt, CtrlAlt, ShiftCtrlAlt, ModMask, ModCompare } |
A type to represent modifier keys. More... | |
Public Member Functions | |
Modifier (Type key=None) | |
Constructs a new modifier from the given modifier key. More... | |
void | Add (Key key) |
Adds the given keyboard key to modifiers. More... | |
void | Add (Type key) |
Adds the given modifier key. More... | |
bool | IsModified () const |
Checks if this modifier really modifies the key state so that no printable characters can be formed. More... | |
operator bool () const | |
Check modifier. More... | |
bool | operator! () const |
Check modifier. More... | |
Modifier | operator& (const Modifier &r) const |
And operator. More... | |
Modifier & | operator&= (const Modifier &r) |
And assignment. More... | |
Modifier & | operator= (const Modifier &)=default |
Assignment operator. More... | |
Modifier | operator| (const Modifier &r) const |
Or operator. More... | |
Modifier & | operator|= (const Modifier &r) |
Or assignment. More... | |
void | Remove (Key key) |
Removes the given keyboard key from modifiers. More... | |
void | Remove (Type key) |
Removes the modifier key. More... | |
Public Attributes | |
Type | Key |
The modifier key. More... | |
This class represents a modifier key. These keys can be.
enum Type |
A type to represent modifier keys.
Enumerator | |
---|---|
None | No modifier is pressed. |
Shift | Only shift modifier is pressed. |
Ctrl | Only control modifier is pressed. |
Alt | Only alt modifier is pressed. |
Meta | Only meta/super/window modifier is pressed. |
ShiftCtrl | Shift and control. |
ShiftAlt | Shift and alt. |
CtrlAlt | Control and alt. |
ShiftCtrlAlt | Shift control alt together. |
ModMask | Modifier mask to check if the key is modified. |
ModCompare | Modifier mask to check if the key is modified. |
void Add | ( | Key | key | ) |
Adds the given keyboard key to modifiers.
References Gorgon::Input::Keyboard::Keycodes::Alt, Modifier::Alt, Gorgon::Input::Keyboard::Keycodes::Control, Modifier::Ctrl, Gorgon::Input::Keyboard::Keycodes::Meta, Modifier::Meta, Gorgon::Input::Keyboard::Keycodes::RAlt, Gorgon::Input::Keyboard::Keycodes::RControl, Gorgon::Input::Keyboard::Keycodes::RMeta, Gorgon::Input::Keyboard::Keycodes::RShift, Gorgon::Input::Keyboard::Keycodes::Shift, and Modifier::Shift.
void Add | ( | Type | key | ) |
Adds the given modifier key.
bool IsModified | ( | ) | const |
Checks if this modifier really modifies the key state so that no printable characters can be formed.
References Modifier::Shift.
|
explicit |
Check modifier.
References Modifier::None.
bool operator! | ( | ) | const |
Check modifier.
References Modifier::None.
And operator.
References Modifier::Key.
And assignment.
References Modifier::Key.
Or operator.
References Modifier::Key.
Or assignment.
References Modifier::Key.
void Remove | ( | Key | key | ) |
Removes the given keyboard key from modifiers.
References Gorgon::Input::Keyboard::Keycodes::Alt, Modifier::Alt, Gorgon::Input::Keyboard::Keycodes::Control, Modifier::Ctrl, Gorgon::Input::Keyboard::Keycodes::Meta, Modifier::Meta, Gorgon::Input::Keyboard::Keycodes::RAlt, Gorgon::Input::Keyboard::Keycodes::RControl, Gorgon::Input::Keyboard::Keycodes::RMeta, Gorgon::Input::Keyboard::Keycodes::RShift, Gorgon::Input::Keyboard::Keycodes::Shift, and Modifier::Shift.
void Remove | ( | Type | key | ) |
Removes the modifier key.