#include <TInputInterface.h>
|
| TDECLARE_CLASS (TInputDevice, TObject) |
|
| TInputDevice () |
|
| ~TInputDevice ()=default |
|
virtual TBOOL | Acquire ()=0 |
|
virtual TBOOL | Unacquire ()=0 |
|
virtual void | Release ()=0 |
|
virtual void | Update (TFLOAT deltaTime)=0 |
|
virtual TBOOL | Flush () |
|
virtual TINT | ProcessEvents (EventEmitter &emitter, TFLOAT deltaTime)=0 |
|
virtual TINT | GetButtonCount () const =0 |
|
virtual TINT | GetAxisCount () const =0 |
|
virtual TBOOL | GetDoodadProperties (Doodad a_iDoodad, DoodadProperties &a_rProperties) const =0 |
|
virtual TBOOL | StartRepeat (Doodad a_iDoodad, TFLOAT a_fFirstRepeatTime, TFLOAT a_fRepeatTime) |
|
virtual void | StopRepeat (Doodad a_iDoodad) |
|
virtual void | StopAllRepeats () |
|
virtual TBOOL | IsForceFeedbackDevice () |
|
virtual const TCHAR * | GetButtonFromDoodad (Doodad a_iDoodad) const =0 |
|
virtual TBOOL | IsDown (Doodad a_iDoodad) const =0 |
|
virtual TINT | GetAxisInt (Doodad a_iDoodad, TINT axis) const =0 |
|
virtual TINT | GetAxisInt2 (Doodad a_iDoodad, TINT axis) const |
|
virtual TFLOAT | GetAxisFloat (Doodad a_iDoodad, TINT axis) const =0 |
|
virtual TFLOAT | GetAxisFloat2 (Doodad a_iDoodad, TINT axis) const |
|
virtual TBOOL | IsEnabled () const =0 |
|
virtual void | ThrowRepeatEvent (EventEmitter &emitter, RepeatInfo *repeatInfo, TFLOAT deltaTime) |
|
TBOOL | IsAcquired () const |
|
void | SetAcquired (TBOOL a_bAcquired) |
|
TInputInterface * | GetInputInterface () |
|
void | SetInputInterface (TInputInterface *a_pInterface) |
|
virtual Toshi::TClass * | GetClass () |
|
virtual void | Delete () |
|
virtual | ~TObject () |
|
TBOOL | IsExactly (TClass *a_pClass) |
|
TBOOL | IsA (TClass *a_pClass) |
|
constexpr | TNode () |
|
constexpr | TNode (const TNode &a_rcNode) |
|
| TNode (TNode &&a_rNode) |
|
T * | Next () const |
|
T * | Prev () const |
|
void | Remove () |
|
void | SetList (TNodeList *list) |
|
TNodeList * | GetList () const |
|
TBOOL | IsLinked () const |
|
Definition at line 114 of file TInputInterface.h.
◆ Doodad
◆ EventEmitter
◆ TInputDevice()
TInputDevice::TInputDevice |
( |
| ) |
|
Definition at line 15 of file TInputDevice.cpp.
17{
21}
TArray< void * > m_Array2
TArray< RepeatInfo > m_Repeats
TInputInterface * m_pInputInterface
◆ ~TInputDevice()
TInputDevice::~TInputDevice |
( |
| ) |
|
|
default |
◆ Acquire()
virtual TBOOL TInputDevice::Acquire |
( |
| ) |
|
|
pure virtual |
◆ Flush()
TBOOL TInputDevice::Flush |
( |
| ) |
|
|
virtual |
◆ GetAxisCount()
virtual TINT TInputDevice::GetAxisCount |
( |
| ) |
const |
|
pure virtual |
◆ GetAxisFloat()
◆ GetAxisFloat2()
virtual TFLOAT TInputDevice::GetAxisFloat2 |
( |
Doodad | a_iDoodad, |
|
|
TINT | axis ) const |
|
inlinevirtual |
Definition at line 162 of file TInputInterface.h.
virtual TFLOAT GetAxisFloat(Doodad a_iDoodad, TINT axis) const =0
◆ GetAxisInt()
virtual TINT TInputDevice::GetAxisInt |
( |
Doodad | a_iDoodad, |
|
|
TINT | axis ) const |
|
pure virtual |
◆ GetAxisInt2()
virtual TINT TInputDevice::GetAxisInt2 |
( |
Doodad | a_iDoodad, |
|
|
TINT | axis ) const |
|
inlinevirtual |
Definition at line 160 of file TInputInterface.h.
virtual TINT GetAxisInt(Doodad a_iDoodad, TINT axis) const =0
◆ GetButtonCount()
virtual TINT TInputDevice::GetButtonCount |
( |
| ) |
const |
|
pure virtual |
◆ GetButtonFromDoodad()
virtual const TCHAR * TInputDevice::GetButtonFromDoodad |
( |
Doodad | a_iDoodad | ) |
const |
|
pure virtual |
◆ GetDoodadProperties()
◆ GetInputInterface()
◆ GetNumRegisteredDevices()
static TUINT TInputDevice::GetNumRegisteredDevices |
( |
| ) |
|
|
inlinestatic |
◆ GetRegisteredDevices()
static TInputDevice ** TInputDevice::GetRegisteredDevices |
( |
| ) |
|
|
inlinestatic |
Definition at line 190 of file TInputInterface.h.
191 {
193 }
static TInputDevice * s_aDevices[MAX_DEVICE_COUNT]
◆ IsAcquired()
TBOOL TInputDevice::IsAcquired |
( |
| ) |
const |
|
inline |
◆ IsDown()
virtual TBOOL TInputDevice::IsDown |
( |
Doodad | a_iDoodad | ) |
const |
|
pure virtual |
◆ IsEnabled()
virtual TBOOL TInputDevice::IsEnabled |
( |
| ) |
const |
|
pure virtual |
◆ IsForceFeedbackDevice()
TBOOL TInputDevice::IsForceFeedbackDevice |
( |
| ) |
|
|
virtual |
◆ ProcessEvents()
◆ ProcessRepeats()
Definition at line 29 of file TInputDevice.cpp.
30{
31 TINT iNumProcessed = 0;
32
34 {
36
37 if (
IsDown( rRepeat.iDoodad ) )
38 {
39 rRepeat.fLeftTime -= a_fDeltaTime;
40
41 if ( rRepeat.fLeftTime <= 0.0f )
42 {
43 rRepeat.fLeftTime = rRepeat.fRepeatTime;
45 iNumProcessed += 1;
46 }
47 }
48 else
49 {
51 {
53 rRepeat.iDoodad = rLastRepeat.iDoodad;
54 rRepeat.fLeftTime = rLastRepeat.fLeftTime;
55 rRepeat.fRepeatTime = rLastRepeat.fRepeatTime;
56 }
57
59 {
61 }
62 }
63 }
64
65 return iNumProcessed;
66}
virtual TBOOL IsDown(Doodad a_iDoodad) const =0
virtual void ThrowRepeatEvent(EventEmitter &emitter, RepeatInfo *repeatInfo, TFLOAT deltaTime)
◆ Release()
virtual void TInputDevice::Release |
( |
| ) |
|
|
pure virtual |
◆ SetAcquired()
void TInputDevice::SetAcquired |
( |
TBOOL | a_bAcquired | ) |
|
|
inline |
◆ SetInputInterface()
◆ StartRepeat()
Definition at line 69 of file TInputDevice.cpp.
70{
72 {
73 if ( it->iDoodad == a_iDoodad )
74 {
75 it->fRepeatTime = a_fRepeatTime;
77 }
78 }
79
81 .fLeftTime = a_fFirstRepeatTime,
82 .fRepeatTime = a_fRepeatTime } );
83
85}
◆ StopAllRepeats()
void TInputDevice::StopAllRepeats |
( |
| ) |
|
|
virtual |
◆ StopRepeat()
void TInputDevice::StopRepeat |
( |
Doodad | a_iDoodad | ) |
|
|
virtual |
Definition at line 88 of file TInputDevice.cpp.
89{
91 {
93
95 while ( it->iDoodad != a_iDoodad )
96 {
97 ++it;
98 ++iIndex;
99 if ( it.IsOver() ) return;
100 }
101
103 {
105 it->iDoodad = rLastRepeat.iDoodad;
106 it->fLeftTime = rLastRepeat.fLeftTime;
107 it->fRepeatTime = rLastRepeat.fRepeatTime;
108 }
109
111 {
113 }
114 }
115}
◆ TDECLARE_CLASS()
◆ ThrowRepeatEvent()
Definition at line 129 of file TInputDevice.cpp.
130{
131 emitter.Throw(
132 TInputInterface::InputEvent(
133 this,
134 repeatInfo->iDoodad,
136 )
137 );
138}
◆ Unacquire()
virtual TBOOL TInputDevice::Unacquire |
( |
| ) |
|
|
pure virtual |
◆ Update()
virtual void TInputDevice::Update |
( |
TFLOAT | deltaTime | ) |
|
|
pure virtual |
◆ INPUT_DEVICE_MOUSE_BUTTONS
TINT TInputDevice::INPUT_DEVICE_MOUSE_BUTTONS = 3 |
|
staticconstexpr |
◆ INPUT_DEVICE_MOUSE_WHEEL
TINT TInputDevice::INPUT_DEVICE_MOUSE_WHEEL = 4 |
|
staticconstexpr |
◆ m_Array2
TArray<void*> TInputDevice::m_Array2 |
|
protected |
◆ m_bIsAcquired
TBOOL TInputDevice::m_bIsAcquired |
|
protected |
◆ m_bUnknown
TBOOL TInputDevice::m_bUnknown |
|
protected |
◆ m_pInputInterface
◆ m_Repeats
◆ m_uiDeviceIndex
TUINT TInputDevice::m_uiDeviceIndex |
|
protected |
◆ MAX_DEVICE_COUNT
TUINT TInputDevice::MAX_DEVICE_COUNT = 14 |
|
staticconstexprprotected |
◆ s_aDevices
◆ s_uiDeviceCount
TUINT TInputDevice::s_uiDeviceCount |
|
inlinestaticprotected |
The documentation for this class was generated from the following files: