summaryrefslogtreecommitdiffstats
path: root/src/input_common/drivers/sdl_driver.cpp
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2023-02-10 02:59:12 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2023-02-10 03:08:54 +0100
commitacba9a6b769f96a35e02669d87ce7b19fc47b025 (patch)
tree7ebd5f331962f67ad037b086c5550c69c6dcaf64 /src/input_common/drivers/sdl_driver.cpp
parentMerge pull request #9749 from ameerj/pr9559-partial-revert (diff)
downloadyuzu-acba9a6b769f96a35e02669d87ce7b19fc47b025.tar
yuzu-acba9a6b769f96a35e02669d87ce7b19fc47b025.tar.gz
yuzu-acba9a6b769f96a35e02669d87ce7b19fc47b025.tar.bz2
yuzu-acba9a6b769f96a35e02669d87ce7b19fc47b025.tar.lz
yuzu-acba9a6b769f96a35e02669d87ce7b19fc47b025.tar.xz
yuzu-acba9a6b769f96a35e02669d87ce7b19fc47b025.tar.zst
yuzu-acba9a6b769f96a35e02669d87ce7b19fc47b025.zip
Diffstat (limited to 'src/input_common/drivers/sdl_driver.cpp')
-rw-r--r--src/input_common/drivers/sdl_driver.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp
index d975eb815..88cacd615 100644
--- a/src/input_common/drivers/sdl_driver.cpp
+++ b/src/input_common/drivers/sdl_driver.cpp
@@ -343,6 +343,14 @@ void SDLDriver::InitJoystick(int joystick_index) {
}
}
+ if (Settings::values.enable_procon_driver) {
+ if (guid.uuid[5] == 0x05 && guid.uuid[4] == 0x7e && guid.uuid[8] == 0x09) {
+ LOG_WARNING(Input, "Preferring joycon driver for device index {}", joystick_index);
+ SDL_JoystickClose(sdl_joystick);
+ return;
+ }
+ }
+
std::scoped_lock lock{joystick_map_mutex};
if (joystick_map.find(guid) == joystick_map.end()) {
auto joystick = std::make_shared<SDLJoystick>(guid, 0, sdl_joystick, sdl_gamecontroller);
@@ -465,13 +473,19 @@ SDLDriver::SDLDriver(std::string input_engine_) : InputEngine(std::move(input_en
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
- // Disable hidapi drivers for switch controllers when the custom joycon driver is enabled
+ // Disable hidapi drivers for joycon controllers when the custom joycon driver is enabled
if (Settings::values.enable_joycon_driver) {
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, "0");
} else {
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, "1");
}
- SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_SWITCH, "1");
+
+ // Disable hidapi drivers for pro controllers when the custom joycon driver is enabled
+ if (Settings::values.enable_procon_driver) {
+ SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_SWITCH, "0");
+ } else {
+ SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_SWITCH, "1");
+ }
// Disable hidapi driver for xbox. Already default on Windows, this causes conflict with native
// driver on Linux.