EHS
HID.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
ehs/Array.h
"
4
#include "
ButtonState.h
"
5
6
#define EHS_HID_UNKNOWN 0
7
8
namespace
ehs
9
{
10
class
EHS_LIB_IO
HID
11
{
12
protected
:
13
UInt_8
type
;
14
UInt_64
hashName
;
15
Str_8
name
;
16
UInt_64
id
;
17
Array<ButtonState>
states
;
18
Button
lastState
;
19
float
heldTime
;
20
float
activateTime
;
21
bool
active
;
22
23
public
:
24
HID
();
25
26
HID
(
UInt_8
type,
Str_8
name, UInt_64
id
);
27
28
HID
(
HID
&& hid)
noexcept
;
29
30
HID
(
const
HID
& hid);
31
32
HID
& operator=(
HID
&& hid)
noexcept
;
33
34
HID
& operator=(
const
HID
& hid);
35
36
bool
operator==
(
const
HID
& other)
const
;
37
38
bool
operator!=
(
const
HID
& other)
const
;
39
40
bool
operator==
(UInt_64 otherId)
const
;
41
42
bool
operator!=
(UInt_64 otherId)
const
;
43
44
virtual
void
Poll(
float
delta);
45
46
UInt_8
GetType()
const
;
47
48
Str_8
GetName()
const
;
49
50
UInt_64 GetId()
const
;
51
52
void
ReleaseAll();
53
54
Vector<const ButtonState*>
GetAllTouched()
const
;
55
56
const
ButtonState
* IsTouched(
const
Button
& button)
const
;
57
58
const
ButtonState
* IsTouched()
const
;
59
60
Vector<const ButtonState*>
GetAllDown()
const
;
61
62
const
ButtonState
* IsDown(
const
Button
& button)
const
;
63
64
const
ButtonState
* IsDown()
const
;
65
66
Vector<const ButtonState*>
GetAllJustReleased()
const
;
67
68
const
ButtonState
* IsJustReleased(
const
Button
& button)
const
;
69
70
const
ButtonState
* IsJustReleased()
const
;
71
72
Vector<const ButtonState*>
GetAllUp()
const
;
73
74
const
ButtonState
* IsUp(
const
Button
& button)
const
;
75
76
const
ButtonState
* IsUp()
const
;
77
78
const
ButtonState
*IsPressed(
const
Button
&button);
79
80
const
ButtonState
*GetPressed();
81
82
void
ButtonDown(
const
Button
& button);
83
84
void
ButtonUp(
const
Button
& button);
85
86
const
ButtonState
* GetState(
const
Button
& button)
const
;
87
88
bool
IsValid()
const
;
89
90
virtual
HID
* Clone()
const
;
91
92
private
:
93
bool
HasState(
const
Button
& button)
const
;
94
95
bool
AddState(
const
ButtonState
& state);
96
97
ButtonState
* GetState(
const
Button
& button);
98
99
bool
TickHoldTime(
float
delta);
100
101
void
ResetTime();
102
103
void
TickActivateTime(
float
delta);
104
};
105
}
Array.h
ButtonState.h
operator!=
bool operator!=(const T *const first, const ehs::Str< T, N > &second)
Definition:
Str.h:1916
operator==
bool operator==(const T *const first, const ehs::Str< T, N > &second)
Definition:
Str.h:1906
ehs::Array
Definition:
Array.h:16
ehs::ButtonState
Definition:
ButtonState.h:17
ehs::Button
Definition:
Button.h:9
ehs::HID
Definition:
HID.h:11
ehs::HID::states
Array< ButtonState > states
Definition:
HID.h:17
ehs::HID::heldTime
float heldTime
Definition:
HID.h:19
ehs::HID::active
bool active
Definition:
HID.h:21
ehs::HID::name
Str_8 name
Definition:
HID.h:15
ehs::HID::lastState
Button lastState
Definition:
HID.h:18
ehs::HID::activateTime
float activateTime
Definition:
HID.h:20
ehs::HID::id
UInt_64 id
Definition:
HID.h:16
ehs::HID::type
UInt_8 type
Definition:
HID.h:13
ehs::HID::hashName
UInt_64 hashName
Definition:
HID.h:14
ehs::Str< Char_8, UInt_64 >
ehs::Vector
Definition:
Vector.h:18
ehs
Definition:
Anchor.h:6
ehs::UInt_8
unsigned char UInt_8
Definition:
Types.h:43
include
ehs
io
hid
HID.h
Generated by
1.9.4