summaryrefslogtreecommitdiff
path: root/src/common/settings_input.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/settings_input.h')
-rw-r--r--src/common/settings_input.h70
1 files changed, 51 insertions, 19 deletions
diff --git a/src/common/settings_input.h b/src/common/settings_input.h
index 609600582..4ff37e186 100644
--- a/src/common/settings_input.h
+++ b/src/common/settings_input.h
@@ -62,11 +62,22 @@ enum Values : int {
62 62
63constexpr int STICK_HID_BEGIN = LStick; 63constexpr int STICK_HID_BEGIN = LStick;
64constexpr int STICK_HID_END = NumAnalogs; 64constexpr int STICK_HID_END = NumAnalogs;
65constexpr int NUM_STICKS_HID = NumAnalogs;
66 65
67extern const std::array<const char*, NumAnalogs> mapping; 66extern const std::array<const char*, NumAnalogs> mapping;
68} // namespace NativeAnalog 67} // namespace NativeAnalog
69 68
69namespace NativeTrigger {
70enum Values : int {
71 LTrigger,
72 RTrigger,
73
74 NumTriggers,
75};
76
77constexpr int TRIGGER_HID_BEGIN = LTrigger;
78constexpr int TRIGGER_HID_END = NumTriggers;
79} // namespace NativeTrigger
80
70namespace NativeVibration { 81namespace NativeVibration {
71enum Values : int { 82enum Values : int {
72 LeftVibrationDevice, 83 LeftVibrationDevice,
@@ -115,10 +126,20 @@ constexpr int NUM_MOUSE_HID = NumMouseButtons;
115extern const std::array<const char*, NumMouseButtons> mapping; 126extern const std::array<const char*, NumMouseButtons> mapping;
116} // namespace NativeMouseButton 127} // namespace NativeMouseButton
117 128
129namespace NativeMouseWheel {
130enum Values {
131 X,
132 Y,
133
134 NumMouseWheels,
135};
136
137extern const std::array<const char*, NumMouseWheels> mapping;
138} // namespace NativeMouseWheel
139
118namespace NativeKeyboard { 140namespace NativeKeyboard {
119enum Keys { 141enum Keys {
120 None, 142 None,
121 Error,
122 143
123 A = 4, 144 A = 4,
124 B, 145 B,
@@ -156,22 +177,22 @@ enum Keys {
156 N8, 177 N8,
157 N9, 178 N9,
158 N0, 179 N0,
159 Enter, 180 Return,
160 Escape, 181 Escape,
161 Backspace, 182 Backspace,
162 Tab, 183 Tab,
163 Space, 184 Space,
164 Minus, 185 Minus,
165 Equal, 186 Plus,
166 LeftBrace, 187 OpenBracket,
167 RightBrace, 188 CloseBracket,
168 Backslash, 189 Pipe,
169 Tilde, 190 Tilde,
170 Semicolon, 191 Semicolon,
171 Apostrophe, 192 Quote,
172 Grave, 193 Backquote,
173 Comma, 194 Comma,
174 Dot, 195 Period,
175 Slash, 196 Slash,
176 CapsLockKey, 197 CapsLockKey,
177 198
@@ -188,7 +209,7 @@ enum Keys {
188 F11, 209 F11,
189 F12, 210 F12,
190 211
191 SystemRequest, 212 PrintScreen,
192 ScrollLockKey, 213 ScrollLockKey,
193 Pause, 214 Pause,
194 Insert, 215 Insert,
@@ -257,8 +278,18 @@ enum Keys {
257 ScrollLockActive, 278 ScrollLockActive,
258 KPComma, 279 KPComma,
259 280
260 KPLeftParenthesis, 281 Ro = 0x87,
261 KPRightParenthesis, 282 KatakanaHiragana,
283 Yen,
284 Henkan,
285 Muhenkan,
286 NumPadCommaPc98,
287
288 HangulEnglish = 0x90,
289 Hanja,
290 KatakanaKey,
291 HiraganaKey,
292 ZenkakuHankaku,
262 293
263 LeftControlKey = 0xE0, 294 LeftControlKey = 0xE0,
264 LeftShiftKey, 295 LeftShiftKey,
@@ -307,6 +338,8 @@ enum Modifiers {
307 CapsLock, 338 CapsLock,
308 ScrollLock, 339 ScrollLock,
309 NumLock, 340 NumLock,
341 Katakana,
342 Hiragana,
310 343
311 NumKeyboardMods, 344 NumKeyboardMods,
312}; 345};
@@ -324,11 +357,6 @@ constexpr int NUM_KEYBOARD_MODS_HID = NumKeyboardMods;
324using AnalogsRaw = std::array<std::string, NativeAnalog::NumAnalogs>; 357using AnalogsRaw = std::array<std::string, NativeAnalog::NumAnalogs>;
325using ButtonsRaw = std::array<std::string, NativeButton::NumButtons>; 358using ButtonsRaw = std::array<std::string, NativeButton::NumButtons>;
326using MotionsRaw = std::array<std::string, NativeMotion::NumMotions>; 359using MotionsRaw = std::array<std::string, NativeMotion::NumMotions>;
327using VibrationsRaw = std::array<std::string, NativeVibration::NumVibrations>;
328
329using MouseButtonsRaw = std::array<std::string, NativeMouseButton::NumMouseButtons>;
330using KeyboardKeysRaw = std::array<std::string, NativeKeyboard::NumKeyboardKeys>;
331using KeyboardModsRaw = std::array<std::string, NativeKeyboard::NumKeyboardMods>;
332 360
333constexpr u32 JOYCON_BODY_NEON_RED = 0xFF3C28; 361constexpr u32 JOYCON_BODY_NEON_RED = 0xFF3C28;
334constexpr u32 JOYCON_BUTTONS_NEON_RED = 0x1E0A0A; 362constexpr u32 JOYCON_BUTTONS_NEON_RED = 0x1E0A0A;
@@ -342,6 +370,11 @@ enum class ControllerType {
342 RightJoycon, 370 RightJoycon,
343 Handheld, 371 Handheld,
344 GameCube, 372 GameCube,
373 Pokeball,
374 NES,
375 SNES,
376 N64,
377 SegaGenesis,
345}; 378};
346 379
347struct PlayerInput { 380struct PlayerInput {
@@ -349,7 +382,6 @@ struct PlayerInput {
349 ControllerType controller_type; 382 ControllerType controller_type;
350 ButtonsRaw buttons; 383 ButtonsRaw buttons;
351 AnalogsRaw analogs; 384 AnalogsRaw analogs;
352 VibrationsRaw vibrations;
353 MotionsRaw motions; 385 MotionsRaw motions;
354 386
355 bool vibration_enabled; 387 bool vibration_enabled;