Cogs.Core
Public Member Functions | Public Attributes | List of all members
Cogs::Core::InputDeviceState Struct Reference

Public Member Functions

 InputDeviceState (const InputDeviceState &)=default
 
void setButton (size_t index, bool state)
 
bool pressed (size_t index) const
 
bool released (size_t index) const
 
void setAxis (size_t index, float value)
 
size_t countBits (uint64_t flags)
 
int8_t highestBit (uint64_t flags)
 

Public Attributes

size_t deviceId = static_cast<size_t>(-1)
 
std::string id
 
std::string alias
 
size_t axisMask = 0
 
size_t buttonMask = 0
 
std::array< float, kMaxAxes > axes = { 0.f }
 
std::array< float, kMaxAxes > axisDeltas = { 0.f }
 
std::array< float, kMaxAxes > deadZones = { kDefaultDeadZone }
 
std::array< size_t, kMaxAxes > linkedDeadZones = { kNoDeadZoneLink }
 
std::array< float, kMaxAxes > sensitivity = { kDefaultSensitivity }
 
std::array< bool, kMaxAxes > invert = { false }
 
std::array< bool, kMaxActions > buttons = { false }
 
std::array< bool, kMaxActions > buttonDeltas = { false }
 
bool isConnected = false
 
bool isValid = false
 
std::unordered_map< std::string, size_t > axisMap
 
std::unordered_map< std::string, size_t > actionMap
 
std::vector< std::string > axisNames
 
std::vector< std::string > actionNames
 
class IInputDevicedevice = nullptr
 

Detailed Description

Definition at line 21 of file InputDeviceState.h.

Member Function Documentation

◆ countBits()

size_t Cogs::Core::InputDeviceState::countBits ( uint64_t  flags)
inline

Definition at line 53 of file InputDeviceState.h.

◆ highestBit()

int8_t Cogs::Core::InputDeviceState::highestBit ( uint64_t  flags)
inline

Definition at line 64 of file InputDeviceState.h.

◆ pressed()

bool Cogs::Core::InputDeviceState::pressed ( size_t  index) const
inline

Definition at line 35 of file InputDeviceState.h.

◆ released()

bool Cogs::Core::InputDeviceState::released ( size_t  index) const
inline

Definition at line 40 of file InputDeviceState.h.

◆ setAxis()

void Cogs::Core::InputDeviceState::setAxis ( size_t  index,
float  value 
)
inline

Definition at line 45 of file InputDeviceState.h.

◆ setButton()

void Cogs::Core::InputDeviceState::setButton ( size_t  index,
bool  state 
)
inline

Definition at line 27 of file InputDeviceState.h.

Member Data Documentation

◆ actionMap

std::unordered_map<std::string, size_t> Cogs::Core::InputDeviceState::actionMap

Definition at line 97 of file InputDeviceState.h.

◆ actionNames

std::vector<std::string> Cogs::Core::InputDeviceState::actionNames

Definition at line 100 of file InputDeviceState.h.

◆ alias

std::string Cogs::Core::InputDeviceState::alias

Definition at line 76 of file InputDeviceState.h.

◆ axes

std::array<float, kMaxAxes> Cogs::Core::InputDeviceState::axes = { 0.f }

Definition at line 81 of file InputDeviceState.h.

◆ axisDeltas

std::array<float, kMaxAxes> Cogs::Core::InputDeviceState::axisDeltas = { 0.f }

Definition at line 82 of file InputDeviceState.h.

◆ axisMap

std::unordered_map<std::string, size_t> Cogs::Core::InputDeviceState::axisMap

Definition at line 96 of file InputDeviceState.h.

◆ axisMask

size_t Cogs::Core::InputDeviceState::axisMask = 0

Definition at line 78 of file InputDeviceState.h.

◆ axisNames

std::vector<std::string> Cogs::Core::InputDeviceState::axisNames

Definition at line 99 of file InputDeviceState.h.

◆ buttonDeltas

std::array<bool, kMaxActions> Cogs::Core::InputDeviceState::buttonDeltas = { false }

Definition at line 91 of file InputDeviceState.h.

◆ buttonMask

size_t Cogs::Core::InputDeviceState::buttonMask = 0

Definition at line 79 of file InputDeviceState.h.

◆ buttons

std::array<bool, kMaxActions> Cogs::Core::InputDeviceState::buttons = { false }

Definition at line 90 of file InputDeviceState.h.

◆ deadZones

std::array<float, kMaxAxes> Cogs::Core::InputDeviceState::deadZones = { kDefaultDeadZone }

Definition at line 85 of file InputDeviceState.h.

◆ device

class IInputDevice* Cogs::Core::InputDeviceState::device = nullptr

Definition at line 102 of file InputDeviceState.h.

◆ deviceId

size_t Cogs::Core::InputDeviceState::deviceId = static_cast<size_t>(-1)

Definition at line 74 of file InputDeviceState.h.

◆ id

std::string Cogs::Core::InputDeviceState::id

Definition at line 75 of file InputDeviceState.h.

◆ invert

std::array<bool, kMaxAxes> Cogs::Core::InputDeviceState::invert = { false }

Definition at line 88 of file InputDeviceState.h.

◆ isConnected

bool Cogs::Core::InputDeviceState::isConnected = false

Definition at line 93 of file InputDeviceState.h.

◆ isValid

bool Cogs::Core::InputDeviceState::isValid = false

Definition at line 94 of file InputDeviceState.h.

◆ linkedDeadZones

std::array<size_t, kMaxAxes> Cogs::Core::InputDeviceState::linkedDeadZones = { kNoDeadZoneLink }

Definition at line 86 of file InputDeviceState.h.

◆ sensitivity

std::array<float, kMaxAxes> Cogs::Core::InputDeviceState::sensitivity = { kDefaultSensitivity }

Definition at line 87 of file InputDeviceState.h.


The documentation for this struct was generated from the following file: