diff options
Diffstat (limited to 'src/common/settings_input.h')
| -rw-r--r-- | src/common/settings_input.h | 70 |
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 | ||
| 63 | constexpr int STICK_HID_BEGIN = LStick; | 63 | constexpr int STICK_HID_BEGIN = LStick; |
| 64 | constexpr int STICK_HID_END = NumAnalogs; | 64 | constexpr int STICK_HID_END = NumAnalogs; |
| 65 | constexpr int NUM_STICKS_HID = NumAnalogs; | ||
| 66 | 65 | ||
| 67 | extern const std::array<const char*, NumAnalogs> mapping; | 66 | extern const std::array<const char*, NumAnalogs> mapping; |
| 68 | } // namespace NativeAnalog | 67 | } // namespace NativeAnalog |
| 69 | 68 | ||
| 69 | namespace NativeTrigger { | ||
| 70 | enum Values : int { | ||
| 71 | LTrigger, | ||
| 72 | RTrigger, | ||
| 73 | |||
| 74 | NumTriggers, | ||
| 75 | }; | ||
| 76 | |||
| 77 | constexpr int TRIGGER_HID_BEGIN = LTrigger; | ||
| 78 | constexpr int TRIGGER_HID_END = NumTriggers; | ||
| 79 | } // namespace NativeTrigger | ||
| 80 | |||
| 70 | namespace NativeVibration { | 81 | namespace NativeVibration { |
| 71 | enum Values : int { | 82 | enum Values : int { |
| 72 | LeftVibrationDevice, | 83 | LeftVibrationDevice, |
| @@ -115,10 +126,20 @@ constexpr int NUM_MOUSE_HID = NumMouseButtons; | |||
| 115 | extern const std::array<const char*, NumMouseButtons> mapping; | 126 | extern const std::array<const char*, NumMouseButtons> mapping; |
| 116 | } // namespace NativeMouseButton | 127 | } // namespace NativeMouseButton |
| 117 | 128 | ||
| 129 | namespace NativeMouseWheel { | ||
| 130 | enum Values { | ||
| 131 | X, | ||
| 132 | Y, | ||
| 133 | |||
| 134 | NumMouseWheels, | ||
| 135 | }; | ||
| 136 | |||
| 137 | extern const std::array<const char*, NumMouseWheels> mapping; | ||
| 138 | } // namespace NativeMouseWheel | ||
| 139 | |||
| 118 | namespace NativeKeyboard { | 140 | namespace NativeKeyboard { |
| 119 | enum Keys { | 141 | enum 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; | |||
| 324 | using AnalogsRaw = std::array<std::string, NativeAnalog::NumAnalogs>; | 357 | using AnalogsRaw = std::array<std::string, NativeAnalog::NumAnalogs>; |
| 325 | using ButtonsRaw = std::array<std::string, NativeButton::NumButtons>; | 358 | using ButtonsRaw = std::array<std::string, NativeButton::NumButtons>; |
| 326 | using MotionsRaw = std::array<std::string, NativeMotion::NumMotions>; | 359 | using MotionsRaw = std::array<std::string, NativeMotion::NumMotions>; |
| 327 | using VibrationsRaw = std::array<std::string, NativeVibration::NumVibrations>; | ||
| 328 | |||
| 329 | using MouseButtonsRaw = std::array<std::string, NativeMouseButton::NumMouseButtons>; | ||
| 330 | using KeyboardKeysRaw = std::array<std::string, NativeKeyboard::NumKeyboardKeys>; | ||
| 331 | using KeyboardModsRaw = std::array<std::string, NativeKeyboard::NumKeyboardMods>; | ||
| 332 | 360 | ||
| 333 | constexpr u32 JOYCON_BODY_NEON_RED = 0xFF3C28; | 361 | constexpr u32 JOYCON_BODY_NEON_RED = 0xFF3C28; |
| 334 | constexpr u32 JOYCON_BUTTONS_NEON_RED = 0x1E0A0A; | 362 | constexpr 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 | ||
| 347 | struct PlayerInput { | 380 | struct 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; |