diff options
Diffstat (limited to 'src/input_common/drivers/sdl_driver.cpp')
| -rw-r--r-- | src/input_common/drivers/sdl_driver.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index 0b24f1858..d5af6c09b 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp | |||
| @@ -220,24 +220,6 @@ public: | |||
| 220 | return "Unknown"; | 220 | return "Unknown"; |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | bool IsYAxis(u8 index) { | ||
| 224 | if (!sdl_controller) { | ||
| 225 | return false; | ||
| 226 | } | ||
| 227 | |||
| 228 | const auto& binding_left_y = | ||
| 229 | SDL_GameControllerGetBindForAxis(sdl_controller.get(), SDL_CONTROLLER_AXIS_LEFTY); | ||
| 230 | const auto& binding_right_y = | ||
| 231 | SDL_GameControllerGetBindForAxis(sdl_controller.get(), SDL_CONTROLLER_AXIS_RIGHTY); | ||
| 232 | if (index == binding_left_y.value.axis) { | ||
| 233 | return true; | ||
| 234 | } | ||
| 235 | if (index == binding_right_y.value.axis) { | ||
| 236 | return true; | ||
| 237 | } | ||
| 238 | return false; | ||
| 239 | } | ||
| 240 | |||
| 241 | private: | 223 | private: |
| 242 | std::string guid; | 224 | std::string guid; |
| 243 | int port; | 225 | int port; |
| @@ -376,11 +358,6 @@ void SDLDriver::HandleGameControllerEvent(const SDL_Event& event) { | |||
| 376 | case SDL_JOYAXISMOTION: { | 358 | case SDL_JOYAXISMOTION: { |
| 377 | if (const auto joystick = GetSDLJoystickBySDLID(event.jaxis.which)) { | 359 | if (const auto joystick = GetSDLJoystickBySDLID(event.jaxis.which)) { |
| 378 | const PadIdentifier identifier = joystick->GetPadIdentifier(); | 360 | const PadIdentifier identifier = joystick->GetPadIdentifier(); |
| 379 | // Vertical axis is inverted on nintendo compared to SDL | ||
| 380 | if (joystick->IsYAxis(event.jaxis.axis)) { | ||
| 381 | SetAxis(identifier, event.jaxis.axis, -event.jaxis.value / 32767.0f); | ||
| 382 | break; | ||
| 383 | } | ||
| 384 | SetAxis(identifier, event.jaxis.axis, event.jaxis.value / 32767.0f); | 361 | SetAxis(identifier, event.jaxis.axis, event.jaxis.value / 32767.0f); |
| 385 | } | 362 | } |
| 386 | break; | 363 | break; |