EHS
ButtonState.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
ehs/EHS.h
"
4
#include "
Button.h
"
5
6
namespace
ehs
7
{
8
enum class
State
9
{
10
JUST_RELEASED
,
11
RELEASED
,
12
PRESSED
,
13
TOUCHED
14
};
15
16
class
EHS_LIB_IO
ButtonState
17
{
18
private
:
19
Button
button;
20
State
state;
21
bool
pressed;
22
float
threshold;
23
24
public
:
25
ButtonState
();
26
27
ButtonState
(
const
Button
& button,
const
State
state);
28
29
ButtonState
(
const
ButtonState
& bs);
30
31
ButtonState
& operator=(
const
ButtonState
& bs);
32
33
bool
operator==
(
const
Button
& other)
const
;
34
35
bool
operator!=
(
const
Button
& other)
const
;
36
37
bool
operator==
(
const
State
otherState)
const
;
38
39
bool
operator!=
(
const
State
otherState)
const
;
40
41
Button
GetButton()
const
;
42
43
void
SetState(
State
newState);
44
45
State
GetState()
const
;
46
47
void
SetPressed(
bool
value);
48
49
bool
IsPressed()
const
;
50
51
void
SetThreshold(
const
float
newThreshold);
52
53
float
GetThreshold()
const
;
54
};
55
}
Button.h
EHS.h
operator!=
bool operator!=(const T *const first, const ehs::Str< T, N > &second)
Definition:
Str.h:1967
operator==
bool operator==(const T *const first, const ehs::Str< T, N > &second)
Definition:
Str.h:1957
ehs::ButtonState
Definition:
ButtonState.h:17
ehs::Button
Definition:
Button.h:9
ehs
Definition:
Anchor.h:6
ehs::State
State
Definition:
ButtonState.h:9
ehs::State::RELEASED
@ RELEASED
ehs::State::PRESSED
@ PRESSED
ehs::State::JUST_RELEASED
@ JUST_RELEASED
ehs::State::TOUCHED
@ TOUCHED
include
ehs
io
hid
ButtonState.h
Generated by
1.9.4