36constexpr auto operator|(ModifierKey a, ModifierKey b) -> ModifierKey {
37 return static_cast<ModifierKey
>(
static_cast<uint8_t
>(a) |
static_cast<uint8_t
>(b));
42 return static_cast<ModifierKey>(
static_cast<uint8_t
>(a) &
static_cast<uint8_t
>(b));
64 Device device = Device::none;
72constexpr int controller_stick_right = 1;
73constexpr int controller_touchpad = 2;
77constexpr int controller_gyro_y = 101;
78constexpr int controller_gyro_z = 102;
auto parseKeycode(std::string_view str) -> KeyCode
Parses a textual keycode such as "keyboard/a", "mouse/left" or "controller/left_stick".
Definition keycodes.cpp:264
ModifierKey
Bit flags for the keyboard modifier keys held during an input.
Definition keycodes.hpp:28
constexpr int controller_gyro_x
Gyro axis codes used as the code for the controller gyro_x/y/z inputs.
Definition keycodes.hpp:76
constexpr int controller_stick_left
Controller stick indices used as the code for InputKind::axis2d controller inputs.
Definition keycodes.hpp:71
InputKind
Dimensionality of an input, used by the input system to pick a sampling path.
Definition keycodes.hpp:48
@ scroll
mouse wheel; code 0 is vertical, code 1 is horizontal
Definition keycodes.hpp:52
@ cursor
mouse cursor position or delta
Definition keycodes.hpp:53
@ axis1d
single-axis analog input such as a trigger or one stick axis
Definition keycodes.hpp:50
@ axis2d
two-axis analog input such as a full stick or the touchpad
Definition keycodes.hpp:51
@ button
on/off input such as a key or a gamepad button
Definition keycodes.hpp:49
Device
Physical device a keycode belongs to.
Definition keycodes.hpp:18