Merge pull request #12083 from JosJuice/android-controlled-by-gamepad

InputConfig: Update IsControllerControlledByGamepadDevice for Android input overhaul
This commit is contained in:
Admiral H. Curtiss 2023-08-18 21:27:26 +02:00 committed by GitHub
commit 9a51215af3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,11 +203,14 @@ bool InputConfig::IsControllerControlledByGamepadDevice(int index) const
const auto& controller = m_controllers.at(index).get()->GetDefaultDevice();
// By default on Android, no device is selected
if (controller.source == "")
return false;
// Filter out anything which obviously not a gamepad
return !((controller.source == "Quartz") // OSX Quartz Keyboard/Mouse
|| (controller.source == "XInput2") // Linux and BSD Keyboard/Mouse
|| (controller.source == "Android" &&
controller.name == "Touchscreen") // Android Touchscreen
|| (controller.source == "Android" && controller.cid <= 0) // Android non-gamepad device
|| (controller.source == "DInput" &&
controller.name == "Keyboard Mouse")); // Windows Keyboard/Mouse
}