8 : device_handle(_device_handle), state(_state)
14 unsigned short _key,
KeyAction _action,
unsigned char _char,
15 unsigned char _modifiers,
double _time)
16 :
vr_event_extension(_device_handle, _state), controller_index(_controller_index), player_index(_player_index),
17 key_event(_key, _action, _char, _modifiers, 0, _time)
52 float _x,
float _dx,
unsigned _player_index,
unsigned _throttle_index,
double _time)
53 :
throttle_event(_x, _dx, _player_index, _controller_index, _throttle_index, _time),
66 StickAction _action,
float _x,
float _y,
float _dx,
float _dy,
67 unsigned _player_index,
unsigned _stick_index,
double _time)
68 :
stick_event(_action, _x, _y, _dx, _dy, _player_index,_controller_index,_stick_index,_time),
81 const float *_pose,
const float *_last_pose,
unsigned short _player_index,
double _time)
82 :
pose_event(_pose, _last_pose, _player_index, _trackable_index, _time),
virtual void stream_out(std::ostream &os) const
write to stream
unsigned char flags
store event flags
unsigned char get_modifiers() const
return the active modifiers as values from EventModifier combined with a logical or-operation
class to represent all possible keyboard events with the EID_KEY
unsigned char get_char() const
return the key as a character
unsigned char action
store whether
void stream_in(std::istream &is)
read from stream
unsigned short key
store the pressed key
class to represent all pose events from tracking systems with the EID_POSE
void stream_out(std::ostream &os) const
write to stream
class to represent stick events with the EID_STICK
void stream_out(std::ostream &os) const
write to stream
class to represent events that inform on a change in a one axis controller with the EID_THROTTLE
void stream_out(std::ostream &os) const
write to stream
interface common to vr events
vr_event_extension(void *_device_handle, const vr::vr_kit_state &_state)
construct extension from device handle and vr state
void * device_handle
store device handle
void stream_out(std::ostream &os) const
write to stream
unsigned short controller_index
store index of controller (0 .. vr::max_nr_controllers-1), controllers with left and right hand role ...
vr_key_event(void *_device_handle, unsigned _player_index, unsigned _controller_index, const vr::vr_kit_state &_state, unsigned short _key=0, KeyAction _action=KA_PRESS, unsigned char _char=0, unsigned char _modifiers=0, double _time=0)
construct a key event from given parameters
void stream_in(std::istream &is)
read from stream
unsigned short player_index
store player index
void stream_out(std::ostream &os) const
write to stream
vr_pose_event(void *_device_handle, short _trackable_index, const vr::vr_kit_state &_state, const float *_pose, const float *_last_pose, unsigned short _player_index, double _time=0)
construct a pose event from given parameters
vr_stick_event(void *_device_handle, unsigned _controller_index, const vr::vr_kit_state &_state, StickAction _action, float _x, float _y, float _dx, float _dy, unsigned _player_index=0, unsigned _stick_index=0, double _time=0)
construct stick event from given parameters
void stream_out(std::ostream &os) const
write to stream
vr_throttle_event(void *_device_handle, unsigned _controller_index, const vr::vr_kit_state &_state, float _x, float _dx, unsigned _player_index=0, unsigned _throttle_index=0, double _time=0)
construct a throttle event from value and value change
void stream_out(std::ostream &os) const
write to stream
KeyAction
different actions that a key can perform
@ KA_REPEAT
key repeated press action
@ KA_PRESS
key press action
@ KA_RELEASE
key release action
StickAction
different actions that a stick can perform
@ EF_VR
whether event is from VR kit
VRButtonStateFlags
one flag for each vr controller button
std::string get_key_string(unsigned short key)
convert key to string
std::string get_state_flag_string(VRButtonStateFlags flags)
convert flags to string
structure that stores all information describing the state of a VR kit