-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput_glyphs_constants.h
137 lines (128 loc) · 4.29 KB
/
input_glyphs_constants.h
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#ifndef INPUT_GLYPHS_CONSTANTS_H
#define INPUT_GLYPHS_CONSTANTS_H
#include "core/object/ref_counted.h"
#include <iterator>
class InputGlyphsConstants : public RefCounted {
GDCLASS(InputGlyphsConstants, RefCounted);
public:
enum InputOrigin {
INPUT_ORIGIN_INVALID = -1,
INPUT_ORIGIN_A,
INPUT_ORIGIN_B,
INPUT_ORIGIN_X,
INPUT_ORIGIN_Y,
INPUT_ORIGIN_VIEW, // Select/Back
INPUT_ORIGIN_MENU, // Start
INPUT_ORIGIN_LEFTBUMPER,
INPUT_ORIGIN_RIGHTBUMPER,
INPUT_ORIGIN_LEFTTRIGGER_PULL,
INPUT_ORIGIN_LEFTTRIGGER_CLICK,
INPUT_ORIGIN_RIGHTTRIGGER_PULL,
INPUT_ORIGIN_RIGHTTRIGGER_CLICK,
INPUT_ORIGIN_LEFTSTICK_MOVE,
INPUT_ORIGIN_LEFTSTICK_CLICK,
INPUT_ORIGIN_LEFTSTICK_DPADNORTH,
INPUT_ORIGIN_LEFTSTICK_DPADSOUTH,
INPUT_ORIGIN_LEFTSTICK_DPADWEST,
INPUT_ORIGIN_LEFTSTICK_DPADEAST,
INPUT_ORIGIN_RIGHTSTICK_MOVE,
INPUT_ORIGIN_RIGHTSTICK_CLICK,
INPUT_ORIGIN_RIGHTSTICK_DPADNORTH,
INPUT_ORIGIN_RIGHTSTICK_DPADSOUTH,
INPUT_ORIGIN_RIGHTSTICK_DPADWEST,
INPUT_ORIGIN_RIGHTSTICK_DPADEAST,
INPUT_ORIGIN_DPAD_NORTH,
INPUT_ORIGIN_DPAD_SOUTH,
INPUT_ORIGIN_DPAD_WEST,
INPUT_ORIGIN_DPAD_EAST,
INPUT_ORIGIN_DPAD_MOVE,
INPUT_ORIGIN_MISC1, // Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button
INPUT_ORIGIN_PADDLE1, // Xbox Elite paddle P1 (upper left, facing the back)
INPUT_ORIGIN_PADDLE2, // Xbox Elite paddle P3 (upper right, facing the back)
INPUT_ORIGIN_PADDLE3, // Xbox Elite paddle P2 (lower left, facing the back)
INPUT_ORIGIN_PADDLE4, // Xbox Elite paddle P4 (lower right, facing the back)
INPUT_ORIGIN_TRACKPAD_CLICK,
INPUT_ORIGIN_COUNT,
};
static constexpr InputOrigin godot_button_to_input_origin_lut[] = {
INPUT_ORIGIN_A,
INPUT_ORIGIN_B,
INPUT_ORIGIN_X,
INPUT_ORIGIN_Y,
INPUT_ORIGIN_VIEW,
INPUT_ORIGIN_INVALID,
INPUT_ORIGIN_MENU,
INPUT_ORIGIN_LEFTSTICK_CLICK,
INPUT_ORIGIN_RIGHTSTICK_CLICK,
INPUT_ORIGIN_LEFTBUMPER,
INPUT_ORIGIN_RIGHTBUMPER,
INPUT_ORIGIN_DPAD_NORTH,
INPUT_ORIGIN_DPAD_SOUTH,
INPUT_ORIGIN_DPAD_WEST,
INPUT_ORIGIN_DPAD_EAST,
INPUT_ORIGIN_MISC1,
INPUT_ORIGIN_PADDLE1,
INPUT_ORIGIN_PADDLE2,
INPUT_ORIGIN_PADDLE3,
INPUT_ORIGIN_PADDLE4,
INPUT_ORIGIN_TRACKPAD_CLICK,
};
static_assert(std::size(godot_button_to_input_origin_lut) == (int)JoyButton::SDL_MAX);
static constexpr char const *_debug_input_origin_names[] = {
"INPUT_ORIGIN_A",
"INPUT_ORIGIN_B",
"INPUT_ORIGIN_X",
"INPUT_ORIGIN_Y",
"INPUT_ORIGIN_VIEW", // Select/Back
"INPUT_ORIGIN_MENU", // Start
"INPUT_ORIGIN_LEFTBUMPER",
"INPUT_ORIGIN_RIGHTBUMPER",
"INPUT_ORIGIN_LEFTTRIGGER_PULL",
"INPUT_ORIGIN_LEFTTRIGGER_CLICK",
"INPUT_ORIGIN_RIGHTTRIGGER_PULL",
"INPUT_ORIGIN_RIGHTTRIGGER_CLICK",
"INPUT_ORIGIN_LEFTSTICK_MOVE",
"INPUT_ORIGIN_LEFTSTICK_CLICK",
"INPUT_ORIGIN_LEFTSTICK_DPADNORTH",
"INPUT_ORIGIN_LEFTSTICK_DPADSOUTH",
"INPUT_ORIGIN_LEFTSTICK_DPADWEST",
"INPUT_ORIGIN_LEFTSTICK_DPADEAST",
"INPUT_ORIGIN_RIGHTSTICK_MOVE",
"INPUT_ORIGIN_RIGHTSTICK_CLICK",
"INPUT_ORIGIN_RIGHTSTICK_DPADNORTH",
"INPUT_ORIGIN_RIGHTSTICK_DPADSOUTH",
"INPUT_ORIGIN_RIGHTSTICK_DPADWEST",
"INPUT_ORIGIN_RIGHTSTICK_DPADEAST",
"INPUT_ORIGIN_DPAD_NORTH",
"INPUT_ORIGIN_DPAD_SOUTH",
"INPUT_ORIGIN_DPAD_WEST",
"INPUT_ORIGIN_DPAD_EAST",
"INPUT_ORIGIN_DPAD_MOVE",
"INPUT_ORIGIN_MISC1", // Xbox Series X share button", PS5 microphone button", Nintendo Switch Pro capture button", Amazon Luna microphone button
"INPUT_ORIGIN_PADDLE1", // Xbox Elite paddle P1 (upper left", facing the back)
"INPUT_ORIGIN_PADDLE2", // Xbox Elite paddle P3 (upper right", facing the back)
"INPUT_ORIGIN_PADDLE3", // Xbox Elite paddle P2 (lower left", facing the back)
"INPUT_ORIGIN_PADDLE4", // Xbox Elite paddle P4 (lower right", facing the back)
"INPUT_ORIGIN_TRACKPAD_CLICK",
};
static_assert(std::size(_debug_input_origin_names) == InputOrigin::INPUT_ORIGIN_COUNT);
enum InputType {
UNKNOWN,
STEAM_CONTROLLER,
XBOX_360_CONTROLLER,
XBOX_ONE_CONTROLLER,
GENERIC_XINPUT_CONTROLLER,
PS3_CONTROLLER,
PS4_CONTROLLER,
PS5_CONTROLLER,
SWITCH_PRO_CONTROLLER,
STEAM_DECK_CONTROLLER,
KEYBOARD,
INPUT_TYPE_MAX
};
protected:
static void _bind_methods();
};
VARIANT_ENUM_CAST(InputGlyphsConstants::InputOrigin);
VARIANT_ENUM_CAST(InputGlyphsConstants::InputType);
#endif // INPUT_GLYPHS_CONSTANTS_H