diff options
Diffstat (limited to 'src/input_common/settings.h')
| -rw-r--r-- | src/input_common/settings.h | 372 |
1 files changed, 0 insertions, 372 deletions
diff --git a/src/input_common/settings.h b/src/input_common/settings.h deleted file mode 100644 index a59f5d461..000000000 --- a/src/input_common/settings.h +++ /dev/null | |||
| @@ -1,372 +0,0 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <array> | ||
| 8 | #include <string> | ||
| 9 | #include "common/common_types.h" | ||
| 10 | |||
| 11 | namespace Settings { | ||
| 12 | namespace NativeButton { | ||
| 13 | enum Values : int { | ||
| 14 | A, | ||
| 15 | B, | ||
| 16 | X, | ||
| 17 | Y, | ||
| 18 | LStick, | ||
| 19 | RStick, | ||
| 20 | L, | ||
| 21 | R, | ||
| 22 | ZL, | ||
| 23 | ZR, | ||
| 24 | Plus, | ||
| 25 | Minus, | ||
| 26 | |||
| 27 | DLeft, | ||
| 28 | DUp, | ||
| 29 | DRight, | ||
| 30 | DDown, | ||
| 31 | |||
| 32 | SL, | ||
| 33 | SR, | ||
| 34 | |||
| 35 | Home, | ||
| 36 | Screenshot, | ||
| 37 | |||
| 38 | NumButtons, | ||
| 39 | }; | ||
| 40 | |||
| 41 | constexpr int BUTTON_HID_BEGIN = A; | ||
| 42 | constexpr int BUTTON_NS_BEGIN = Home; | ||
| 43 | |||
| 44 | constexpr int BUTTON_HID_END = BUTTON_NS_BEGIN; | ||
| 45 | constexpr int BUTTON_NS_END = NumButtons; | ||
| 46 | |||
| 47 | constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN; | ||
| 48 | constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN; | ||
| 49 | |||
| 50 | extern const std::array<const char*, NumButtons> mapping; | ||
| 51 | |||
| 52 | } // namespace NativeButton | ||
| 53 | |||
| 54 | namespace NativeAnalog { | ||
| 55 | enum Values : int { | ||
| 56 | LStick, | ||
| 57 | RStick, | ||
| 58 | |||
| 59 | NumAnalogs, | ||
| 60 | }; | ||
| 61 | |||
| 62 | constexpr int STICK_HID_BEGIN = LStick; | ||
| 63 | constexpr int STICK_HID_END = NumAnalogs; | ||
| 64 | constexpr int NUM_STICKS_HID = NumAnalogs; | ||
| 65 | |||
| 66 | extern const std::array<const char*, NumAnalogs> mapping; | ||
| 67 | } // namespace NativeAnalog | ||
| 68 | |||
| 69 | namespace NativeVibration { | ||
| 70 | enum Values : int { | ||
| 71 | LeftVibrationDevice, | ||
| 72 | RightVibrationDevice, | ||
| 73 | |||
| 74 | NumVibrations, | ||
| 75 | }; | ||
| 76 | |||
| 77 | constexpr int VIBRATION_HID_BEGIN = LeftVibrationDevice; | ||
| 78 | constexpr int VIBRATION_HID_END = NumVibrations; | ||
| 79 | constexpr int NUM_VIBRATIONS_HID = NumVibrations; | ||
| 80 | |||
| 81 | extern const std::array<const char*, NumVibrations> mapping; | ||
| 82 | }; // namespace NativeVibration | ||
| 83 | |||
| 84 | namespace NativeMotion { | ||
| 85 | enum Values : int { | ||
| 86 | MotionLeft, | ||
| 87 | MotionRight, | ||
| 88 | |||
| 89 | NumMotions, | ||
| 90 | }; | ||
| 91 | |||
| 92 | constexpr int MOTION_HID_BEGIN = MotionLeft; | ||
| 93 | constexpr int MOTION_HID_END = NumMotions; | ||
| 94 | constexpr int NUM_MOTIONS_HID = NumMotions; | ||
| 95 | |||
| 96 | extern const std::array<const char*, NumMotions> mapping; | ||
| 97 | } // namespace NativeMotion | ||
| 98 | |||
| 99 | namespace NativeMouseButton { | ||
| 100 | enum Values { | ||
| 101 | Left, | ||
| 102 | Right, | ||
| 103 | Middle, | ||
| 104 | Forward, | ||
| 105 | Back, | ||
| 106 | |||
| 107 | NumMouseButtons, | ||
| 108 | }; | ||
| 109 | |||
| 110 | constexpr int MOUSE_HID_BEGIN = Left; | ||
| 111 | constexpr int MOUSE_HID_END = NumMouseButtons; | ||
| 112 | constexpr int NUM_MOUSE_HID = NumMouseButtons; | ||
| 113 | |||
| 114 | extern const std::array<const char*, NumMouseButtons> mapping; | ||
| 115 | } // namespace NativeMouseButton | ||
| 116 | |||
| 117 | namespace NativeKeyboard { | ||
| 118 | enum Keys { | ||
| 119 | None, | ||
| 120 | Error, | ||
| 121 | |||
| 122 | A = 4, | ||
| 123 | B, | ||
| 124 | C, | ||
| 125 | D, | ||
| 126 | E, | ||
| 127 | F, | ||
| 128 | G, | ||
| 129 | H, | ||
| 130 | I, | ||
| 131 | J, | ||
| 132 | K, | ||
| 133 | L, | ||
| 134 | M, | ||
| 135 | N, | ||
| 136 | O, | ||
| 137 | P, | ||
| 138 | Q, | ||
| 139 | R, | ||
| 140 | S, | ||
| 141 | T, | ||
| 142 | U, | ||
| 143 | V, | ||
| 144 | W, | ||
| 145 | X, | ||
| 146 | Y, | ||
| 147 | Z, | ||
| 148 | N1, | ||
| 149 | N2, | ||
| 150 | N3, | ||
| 151 | N4, | ||
| 152 | N5, | ||
| 153 | N6, | ||
| 154 | N7, | ||
| 155 | N8, | ||
| 156 | N9, | ||
| 157 | N0, | ||
| 158 | Enter, | ||
| 159 | Escape, | ||
| 160 | Backspace, | ||
| 161 | Tab, | ||
| 162 | Space, | ||
| 163 | Minus, | ||
| 164 | Equal, | ||
| 165 | LeftBrace, | ||
| 166 | RightBrace, | ||
| 167 | Backslash, | ||
| 168 | Tilde, | ||
| 169 | Semicolon, | ||
| 170 | Apostrophe, | ||
| 171 | Grave, | ||
| 172 | Comma, | ||
| 173 | Dot, | ||
| 174 | Slash, | ||
| 175 | CapsLockKey, | ||
| 176 | |||
| 177 | F1, | ||
| 178 | F2, | ||
| 179 | F3, | ||
| 180 | F4, | ||
| 181 | F5, | ||
| 182 | F6, | ||
| 183 | F7, | ||
| 184 | F8, | ||
| 185 | F9, | ||
| 186 | F10, | ||
| 187 | F11, | ||
| 188 | F12, | ||
| 189 | |||
| 190 | SystemRequest, | ||
| 191 | ScrollLockKey, | ||
| 192 | Pause, | ||
| 193 | Insert, | ||
| 194 | Home, | ||
| 195 | PageUp, | ||
| 196 | Delete, | ||
| 197 | End, | ||
| 198 | PageDown, | ||
| 199 | Right, | ||
| 200 | Left, | ||
| 201 | Down, | ||
| 202 | Up, | ||
| 203 | |||
| 204 | NumLockKey, | ||
| 205 | KPSlash, | ||
| 206 | KPAsterisk, | ||
| 207 | KPMinus, | ||
| 208 | KPPlus, | ||
| 209 | KPEnter, | ||
| 210 | KP1, | ||
| 211 | KP2, | ||
| 212 | KP3, | ||
| 213 | KP4, | ||
| 214 | KP5, | ||
| 215 | KP6, | ||
| 216 | KP7, | ||
| 217 | KP8, | ||
| 218 | KP9, | ||
| 219 | KP0, | ||
| 220 | KPDot, | ||
| 221 | |||
| 222 | Key102, | ||
| 223 | Compose, | ||
| 224 | Power, | ||
| 225 | KPEqual, | ||
| 226 | |||
| 227 | F13, | ||
| 228 | F14, | ||
| 229 | F15, | ||
| 230 | F16, | ||
| 231 | F17, | ||
| 232 | F18, | ||
| 233 | F19, | ||
| 234 | F20, | ||
| 235 | F21, | ||
| 236 | F22, | ||
| 237 | F23, | ||
| 238 | F24, | ||
| 239 | |||
| 240 | Open, | ||
| 241 | Help, | ||
| 242 | Properties, | ||
| 243 | Front, | ||
| 244 | Stop, | ||
| 245 | Repeat, | ||
| 246 | Undo, | ||
| 247 | Cut, | ||
| 248 | Copy, | ||
| 249 | Paste, | ||
| 250 | Find, | ||
| 251 | Mute, | ||
| 252 | VolumeUp, | ||
| 253 | VolumeDown, | ||
| 254 | CapsLockActive, | ||
| 255 | NumLockActive, | ||
| 256 | ScrollLockActive, | ||
| 257 | KPComma, | ||
| 258 | |||
| 259 | KPLeftParenthesis, | ||
| 260 | KPRightParenthesis, | ||
| 261 | |||
| 262 | LeftControlKey = 0xE0, | ||
| 263 | LeftShiftKey, | ||
| 264 | LeftAltKey, | ||
| 265 | LeftMetaKey, | ||
| 266 | RightControlKey, | ||
| 267 | RightShiftKey, | ||
| 268 | RightAltKey, | ||
| 269 | RightMetaKey, | ||
| 270 | |||
| 271 | MediaPlayPause, | ||
| 272 | MediaStopCD, | ||
| 273 | MediaPrevious, | ||
| 274 | MediaNext, | ||
| 275 | MediaEject, | ||
| 276 | MediaVolumeUp, | ||
| 277 | MediaVolumeDown, | ||
| 278 | MediaMute, | ||
| 279 | MediaWebsite, | ||
| 280 | MediaBack, | ||
| 281 | MediaForward, | ||
| 282 | MediaStop, | ||
| 283 | MediaFind, | ||
| 284 | MediaScrollUp, | ||
| 285 | MediaScrollDown, | ||
| 286 | MediaEdit, | ||
| 287 | MediaSleep, | ||
| 288 | MediaCoffee, | ||
| 289 | MediaRefresh, | ||
| 290 | MediaCalculator, | ||
| 291 | |||
| 292 | NumKeyboardKeys, | ||
| 293 | }; | ||
| 294 | |||
| 295 | static_assert(NumKeyboardKeys == 0xFC, "Incorrect number of keyboard keys."); | ||
| 296 | |||
| 297 | enum Modifiers { | ||
| 298 | LeftControl, | ||
| 299 | LeftShift, | ||
| 300 | LeftAlt, | ||
| 301 | LeftMeta, | ||
| 302 | RightControl, | ||
| 303 | RightShift, | ||
| 304 | RightAlt, | ||
| 305 | RightMeta, | ||
| 306 | CapsLock, | ||
| 307 | ScrollLock, | ||
| 308 | NumLock, | ||
| 309 | |||
| 310 | NumKeyboardMods, | ||
| 311 | }; | ||
| 312 | |||
| 313 | constexpr int KEYBOARD_KEYS_HID_BEGIN = None; | ||
| 314 | constexpr int KEYBOARD_KEYS_HID_END = NumKeyboardKeys; | ||
| 315 | constexpr int NUM_KEYBOARD_KEYS_HID = NumKeyboardKeys; | ||
| 316 | |||
| 317 | constexpr int KEYBOARD_MODS_HID_BEGIN = LeftControl; | ||
| 318 | constexpr int KEYBOARD_MODS_HID_END = NumKeyboardMods; | ||
| 319 | constexpr int NUM_KEYBOARD_MODS_HID = NumKeyboardMods; | ||
| 320 | |||
| 321 | } // namespace NativeKeyboard | ||
| 322 | |||
| 323 | using AnalogsRaw = std::array<std::string, NativeAnalog::NumAnalogs>; | ||
| 324 | using ButtonsRaw = std::array<std::string, NativeButton::NumButtons>; | ||
| 325 | using MotionsRaw = std::array<std::string, NativeMotion::NumMotions>; | ||
| 326 | using VibrationsRaw = std::array<std::string, NativeVibration::NumVibrations>; | ||
| 327 | |||
| 328 | using MouseButtonsRaw = std::array<std::string, NativeMouseButton::NumMouseButtons>; | ||
| 329 | using KeyboardKeysRaw = std::array<std::string, NativeKeyboard::NumKeyboardKeys>; | ||
| 330 | using KeyboardModsRaw = std::array<std::string, NativeKeyboard::NumKeyboardMods>; | ||
| 331 | |||
| 332 | constexpr u32 JOYCON_BODY_NEON_RED = 0xFF3C28; | ||
| 333 | constexpr u32 JOYCON_BUTTONS_NEON_RED = 0x1E0A0A; | ||
| 334 | constexpr u32 JOYCON_BODY_NEON_BLUE = 0x0AB9E6; | ||
| 335 | constexpr u32 JOYCON_BUTTONS_NEON_BLUE = 0x001E1E; | ||
| 336 | |||
| 337 | enum class ControllerType { | ||
| 338 | ProController, | ||
| 339 | DualJoyconDetached, | ||
| 340 | LeftJoycon, | ||
| 341 | RightJoycon, | ||
| 342 | Handheld, | ||
| 343 | GameCube, | ||
| 344 | }; | ||
| 345 | |||
| 346 | struct PlayerInput { | ||
| 347 | bool connected; | ||
| 348 | ControllerType controller_type; | ||
| 349 | ButtonsRaw buttons; | ||
| 350 | AnalogsRaw analogs; | ||
| 351 | VibrationsRaw vibrations; | ||
| 352 | MotionsRaw motions; | ||
| 353 | |||
| 354 | bool vibration_enabled; | ||
| 355 | int vibration_strength; | ||
| 356 | |||
| 357 | u32 body_color_left; | ||
| 358 | u32 body_color_right; | ||
| 359 | u32 button_color_left; | ||
| 360 | u32 button_color_right; | ||
| 361 | }; | ||
| 362 | |||
| 363 | struct TouchscreenInput { | ||
| 364 | bool enabled; | ||
| 365 | std::string device; | ||
| 366 | |||
| 367 | u32 finger; | ||
| 368 | u32 diameter_x; | ||
| 369 | u32 diameter_y; | ||
| 370 | u32 rotation_angle; | ||
| 371 | }; | ||
| 372 | } // namespace Settings | ||