Nebula
Loading...
Searching...
No Matches
modifier.h File Reference
#include "core/types.h"
#include "input/key.h"
#include "util/string.h"

Go to the source code of this file.

Namespaces

namespace  Input::Modifier
 The modifier keys as a bitmask.
namespace  Input
 FIXME!

Typedefs

using Input::Modifier::Code = uint32_t

Functions

Code Input::Modifier::FromKey (Key::Code key)
 The bit a key code has, or NoModifier when the key is not a modifier key.
bool Input::Modifier::IsModifier (Key::Code key)
 Returns true when the key code is one of the modifier keys.
Code Input::Modifier::Logical (Code bit)
 The group a bit belongs to.
bool Input::Modifier::Matches (Code required, Code held)
 Return true when the held bits satisfy the requirement.
IndexT Input::Modifier::Count (Code required)
 The number of groups a requirement has.
Util::String Input::Modifier::ToString (Code mods)
 The modifiers as the combo string writes them: the groups, in the order a combo is written in.
Code Input::Modifier::FromString (const Util::String &token)
 read one combo token as a modifier. Returns NoModifier when the token is not a modifier

Variables

constexpr Code Input::Modifier::NoModifier = 0
constexpr Code Input::Modifier::LeftControlModifier = 1 << 0
constexpr Code Input::Modifier::RightControlModifier = 1 << 1
constexpr Code Input::Modifier::LeftShiftModifier = 1 << 2
constexpr Code Input::Modifier::RightShiftModifier = 1 << 3
constexpr Code Input::Modifier::LeftAltModifier = 1 << 4
constexpr Code Input::Modifier::RightAltModifier = 1 << 5
constexpr Code Input::Modifier::LeftSuperModifier = 1 << 6
constexpr Code Input::Modifier::RightSuperModifier = 1 << 7
constexpr Code Input::Modifier::ControlModifier = LeftControlModifier | RightControlModifier
constexpr Code Input::Modifier::ShiftModifier = LeftShiftModifier | RightShiftModifier
constexpr Code Input::Modifier::AltModifier = LeftAltModifier | RightAltModifier
constexpr Code Input::Modifier::SuperModifier = LeftSuperModifier | RightSuperModifier
constexpr Code Input::Modifier::GroupMasks [] = { ControlModifier, ShiftModifier, AltModifier, SuperModifier }
constexpr const char * Input::Modifier::GroupNames [] = { "ctrl", "shift", "alt", "super" }
constexpr IndexT Input::Modifier::NumGroups = 4
constexpr Key::Code Input::Modifier::Keys []
constexpr IndexT Input::Modifier::NumKeys = 11