diff options
| author | 2023-11-11 20:54:06 -0600 | |
|---|---|---|
| committer | 2023-11-11 21:03:15 -0600 | |
| commit | ae57a99d7d2063661cc15e76e8183122d8e0bc1b (patch) | |
| tree | 206b82f9387b93dbdc08408ceff88c24814f3237 /src/input_common/drivers/sdl_driver.cpp | |
| parent | Merge pull request #11980 from german77/moment (diff) | |
| download | yuzu-ae57a99d7d2063661cc15e76e8183122d8e0bc1b.tar.gz yuzu-ae57a99d7d2063661cc15e76e8183122d8e0bc1b.tar.xz yuzu-ae57a99d7d2063661cc15e76e8183122d8e0bc1b.zip | |
core: hid: Split SL and SR buttons
Diffstat (limited to '')
| -rw-r--r-- | src/input_common/drivers/sdl_driver.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index 66e3ae9af..78f458afe 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp | |||
| @@ -828,16 +828,18 @@ ButtonMapping SDLDriver::GetButtonMappingForDevice(const Common::ParamPackage& p | |||
| 828 | ButtonBindings SDLDriver::GetDefaultButtonBinding( | 828 | ButtonBindings SDLDriver::GetDefaultButtonBinding( |
| 829 | const std::shared_ptr<SDLJoystick>& joystick) const { | 829 | const std::shared_ptr<SDLJoystick>& joystick) const { |
| 830 | // Default SL/SR mapping for other controllers | 830 | // Default SL/SR mapping for other controllers |
| 831 | auto sl_button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER; | 831 | auto sll_button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER; |
| 832 | auto sr_button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER; | 832 | auto srl_button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER; |
| 833 | auto slr_button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER; | ||
| 834 | auto srr_button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER; | ||
| 833 | 835 | ||
| 834 | if (joystick->IsJoyconLeft()) { | 836 | if (joystick->IsJoyconLeft()) { |
| 835 | sl_button = SDL_CONTROLLER_BUTTON_PADDLE2; | 837 | sll_button = SDL_CONTROLLER_BUTTON_PADDLE2; |
| 836 | sr_button = SDL_CONTROLLER_BUTTON_PADDLE4; | 838 | srl_button = SDL_CONTROLLER_BUTTON_PADDLE4; |
| 837 | } | 839 | } |
| 838 | if (joystick->IsJoyconRight()) { | 840 | if (joystick->IsJoyconRight()) { |
| 839 | sl_button = SDL_CONTROLLER_BUTTON_PADDLE3; | 841 | slr_button = SDL_CONTROLLER_BUTTON_PADDLE3; |
| 840 | sr_button = SDL_CONTROLLER_BUTTON_PADDLE1; | 842 | srr_button = SDL_CONTROLLER_BUTTON_PADDLE1; |
| 841 | } | 843 | } |
| 842 | 844 | ||
| 843 | return { | 845 | return { |
| @@ -855,8 +857,10 @@ ButtonBindings SDLDriver::GetDefaultButtonBinding( | |||
| 855 | {Settings::NativeButton::DUp, SDL_CONTROLLER_BUTTON_DPAD_UP}, | 857 | {Settings::NativeButton::DUp, SDL_CONTROLLER_BUTTON_DPAD_UP}, |
| 856 | {Settings::NativeButton::DRight, SDL_CONTROLLER_BUTTON_DPAD_RIGHT}, | 858 | {Settings::NativeButton::DRight, SDL_CONTROLLER_BUTTON_DPAD_RIGHT}, |
| 857 | {Settings::NativeButton::DDown, SDL_CONTROLLER_BUTTON_DPAD_DOWN}, | 859 | {Settings::NativeButton::DDown, SDL_CONTROLLER_BUTTON_DPAD_DOWN}, |
| 858 | {Settings::NativeButton::SL, sl_button}, | 860 | {Settings::NativeButton::SLLeft, sll_button}, |
| 859 | {Settings::NativeButton::SR, sr_button}, | 861 | {Settings::NativeButton::SRLeft, srl_button}, |
| 862 | {Settings::NativeButton::SLRight, slr_button}, | ||
| 863 | {Settings::NativeButton::SRRight, srr_button}, | ||
| 860 | {Settings::NativeButton::Home, SDL_CONTROLLER_BUTTON_GUIDE}, | 864 | {Settings::NativeButton::Home, SDL_CONTROLLER_BUTTON_GUIDE}, |
| 861 | {Settings::NativeButton::Screenshot, SDL_CONTROLLER_BUTTON_MISC1}, | 865 | {Settings::NativeButton::Screenshot, SDL_CONTROLLER_BUTTON_MISC1}, |
| 862 | }; | 866 | }; |