Utility class that contains the combination of the modifier keys pressed.
More...
#include <luciad/input/ModifierKeys.h>
Utility class that contains the combination of the modifier keys pressed.
The modifiers keys are mapped to the following values:
- None => 0
- Alt => 1
- Ctrl => 2
- Shift => 4
- Note
- Don't use the
hasFlag
method if you want to check that there are no modifiers set, instead do
EXPECT_FALSE(checkNone);
EXPECT_TRUE(checkNone);
static const ModifierKeys & shift()
A ModifierKeys instance that represents the Shift modifier key.
static const ModifierKeys & none()
A ModifierKeys instance that represents no modifier keys.
An example usage is:
static const ModifierKeys & alt()
A ModifierKeys instance that represents the Alt modifier key.
static const ModifierKeys & ctrl()
A ModifierKeys instance that represents the Ctrl modifier key.
- See also
- luciad::KeyCode for the available key codes to use in conjunction with this class.
- Since
- 2020.1
◆ ModifierKeys()
constexpr luciad::ModifierKeys::ModifierKeys |
( |
size_t |
keys | ) |
|
|
inlineexplicitconstexpr |
Creates a new instance.
- Parameters
-
keys | the bits that represent the modifier keys. |
◆ alt()
A ModifierKeys instance that represents the Alt modifier key.
◆ ctrl()
A ModifierKeys instance that represents the Ctrl modifier key.
◆ getKeys()
constexpr size_t luciad::ModifierKeys::getKeys |
( |
| ) |
const |
|
inlineconstexpr |
Returns the combined pressed modifier keys.
- Returns
- the combined pressed modifier keys.
◆ hasFlag()
constexpr bool luciad::ModifierKeys::hasFlag |
( |
ModifierKeys |
keys | ) |
const |
|
inlineconstexpr |
Returns if the specified modifier keys are pressed.
- Parameters
-
- Returns
- if the keys are pressed
◆ none()
◆ operator!=()
bool luciad::ModifierKeys::operator!= |
( |
const ModifierKeys & |
other | ) |
const |
|
inline |
◆ operator&()
◆ operator&=()
◆ operator=()
◆ operator==()
bool luciad::ModifierKeys::operator== |
( |
const ModifierKeys & |
other | ) |
const |
|
inline |
◆ operator^()
◆ operator^=()
◆ operator|()
◆ operator|=()
◆ operator~()
constexpr ModifierKeys luciad::ModifierKeys::operator~ |
( |
| ) |
const |
|
inlineconstexpr |
◆ shift()
A ModifierKeys instance that represents the Shift modifier key.