#include <Control.h>
Classes | |
union | TEventDependantData |
Data of an event of a control, which can be an axis or a switch (union). More... | |
Public Types | |
enum | EEventType { SWITCH_DOWN, SWITCH_UP, AXIS, LAST_NETWORK_EVENT, GFX_FRAME = LAST_NETWORK_EVENT, GFX_RESIZE } |
Public Member Functions | |
ControlEvent (double time, EEventType type) | |
Builds an event. | |
ControlEvent (double time, ControlState::ESwitchId switchId, int unmappedKey, bool down) | |
Builds a switch event. | |
ControlEvent (double time, ControlState::EAxisId axisId, float movement) | |
Builds an axis event. | |
ControlEvent (const ControlEvent &v) | |
Copies an event. | |
double | getTime () const |
Gets the timestamp of the event. | |
EEventType | getType () const |
Gets the type of the event. | |
ControlState::ESwitchId | getSwitchId () const |
Returns the switch ID if the event is about a switch (result is undefined otherwise). | |
int | getUnmappedKey () const |
Returns the unmapped key if the event is about a switch (result is undefined otherwise). | |
ControlState::EAxisId | getAxisId () const |
Returns the axis ID if the event is about an axis (result is undefined otherwise). | |
float | getAxisMovement () const |
Returns the axis relative movement if the event is about an axis (result is undefined otherwise). | |
Protected Attributes | |
double | time |
Timestamp of the event. | |
EEventType | type |
Type of the event. | |
TEventDependantData | data |
Definition at line 172 of file Control.h.
ControlEvent::ControlEvent | ( | double | time, | |
EEventType | type | |||
) | [inline] |
ControlEvent::ControlEvent | ( | double | time, | |
ControlState::ESwitchId | switchId, | |||
int | unmappedKey, | |||
bool | down | |||
) | [inline] |
Builds a switch event.
Definition at line 184 of file Control.h.
References data, TrivialPair< T1, T2 >::first, TrivialPair< T1, T2 >::second, SWITCH_DOWN, SWITCH_UP, ControlEvent::TEventDependantData::switchId, and type.
ControlEvent::ControlEvent | ( | double | time, | |
ControlState::EAxisId | axisId, | |||
float | movement | |||
) | [inline] |
Builds an axis event.
Definition at line 186 of file Control.h.
References ControlEvent::TEventDependantData::axisMovement, data, TrivialPair< T1, T2 >::first, and TrivialPair< T1, T2 >::second.
ControlEvent::ControlEvent | ( | const ControlEvent & | v | ) | [inline] |
Copies an event.
Definition at line 188 of file Control.h.
References AXIS, ControlEvent::TEventDependantData::axisMovement, data, SWITCH_DOWN, SWITCH_UP, ControlEvent::TEventDependantData::switchId, and type.
ControlState::EAxisId ControlEvent::getAxisId | ( | ) | const [inline] |
Returns the axis ID if the event is about an axis (result is undefined otherwise).
Definition at line 203 of file Control.h.
References ASSERT, AXIS, ControlEvent::TEventDependantData::axisMovement, data, TrivialPair< T1, T2 >::first, and type.
Referenced by ControlMapper::onControlEventReceived().
float ControlEvent::getAxisMovement | ( | ) | const [inline] |
Returns the axis relative movement if the event is about an axis (result is undefined otherwise).
Definition at line 205 of file Control.h.
References ASSERT, AXIS, ControlEvent::TEventDependantData::axisMovement, data, TrivialPair< T1, T2 >::second, and type.
Referenced by ControlMapper::onControlEventReceived().
ControlState::ESwitchId ControlEvent::getSwitchId | ( | ) | const [inline] |
Returns the switch ID if the event is about a switch (result is undefined otherwise).
Definition at line 199 of file Control.h.
References ASSERT, data, TrivialPair< T1, T2 >::first, SWITCH_DOWN, SWITCH_UP, ControlEvent::TEventDependantData::switchId, and type.
Referenced by ControlMapper::onControlEventReceived().
double ControlEvent::getTime | ( | ) | const [inline] |
Gets the timestamp of the event.
Definition at line 194 of file Control.h.
References time.
Referenced by ControlMapper::onControlEventReceived().
EEventType ControlEvent::getType | ( | ) | const [inline] |
Gets the type of the event.
Definition at line 196 of file Control.h.
References type.
Referenced by ControlMapper::onControlEventReceived().
int ControlEvent::getUnmappedKey | ( | ) | const [inline] |
Returns the unmapped key if the event is about a switch (result is undefined otherwise).
Definition at line 201 of file Control.h.
References ASSERT, data, TrivialPair< T1, T2 >::second, SWITCH_DOWN, SWITCH_UP, ControlEvent::TEventDependantData::switchId, and type.
Referenced by ControlMapper::onControlEventReceived().
TEventDependantData ControlEvent::data [protected] |
Definition at line 218 of file Control.h.
Referenced by ControlEvent(), getAxisId(), getAxisMovement(), getSwitchId(), and getUnmappedKey().
double ControlEvent::time [protected] |
EEventType ControlEvent::type [protected] |
Type of the event.
Definition at line 209 of file Control.h.
Referenced by ControlEvent(), getAxisId(), getAxisMovement(), getSwitchId(), getType(), and getUnmappedKey().