-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxboxcontroller.h
More file actions
74 lines (53 loc) · 2.21 KB
/
xboxcontroller.h
File metadata and controls
74 lines (53 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include "controllers.h"
namespace xbox
{
const int axis_input_threshold = 0.025;
enum INPUT_CODE {
A = 304,
B = 305,
X = 307,
Y = 308,
LB = 310,
RB = 311,
L_STICK_PRESS = 317,
R_STICK_PRESS = 318,
XBOX_BUTTON = 316,
WINDOW = 314,
HAMBURGER = 315,
SCREENSHOT = 167,
DPAD_VERTICAL = 17,
DPAD_HORIZONTAL = 16,
L_TRIGGER = 2,
R_TRIGGER = 5,
L_STICK_VERTICAL = 0,
L_STICK_HORIZONTAL = 1,
R_STICK_VERTICAL = 3,
R_STICK_HORIZONTAL = 4
};
struct XboxControllerState : ControllerState {
XboxControllerState() {
inputs = {
{identifier(controller::BUTTON, A), consumable()},
{identifier(controller::BUTTON, B), consumable()},
{identifier(controller::BUTTON, X), consumable()},
{identifier(controller::BUTTON, Y), consumable()},
{identifier(controller::BUTTON, LB), consumable()},
{identifier(controller::BUTTON, RB), consumable()},
{identifier(controller::BUTTON, L_STICK_PRESS), consumable()},
{identifier(controller::BUTTON, R_STICK_PRESS), consumable()},
{identifier(controller::BUTTON, XBOX_BUTTON), consumable()},
{identifier(controller::BUTTON, WINDOW), consumable()},
{identifier(controller::BUTTON, HAMBURGER), consumable()},
{identifier(controller::BUTTON, SCREENSHOT), consumable()},
{identifier(controller::AXIS, DPAD_VERTICAL), consumable()},
{identifier(controller::AXIS, DPAD_HORIZONTAL), consumable()},
{identifier(controller::AXIS, L_TRIGGER), consumable()},
{identifier(controller::AXIS, R_TRIGGER), consumable()},
{identifier(controller::AXIS, L_STICK_VERTICAL), consumable()},
{identifier(controller::AXIS, L_STICK_HORIZONTAL), consumable()},
{identifier(controller::AXIS, R_STICK_VERTICAL), consumable()},
{identifier(controller::AXIS, R_STICK_HORIZONTAL), consumable()},
};
};
};
}