Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #12083 from JosJuice/android-controlled-by-gamepad
InputConfig: Update IsControllerControlledByGamepadDevice for Android input overhaul
  • Loading branch information
AdmiralCurtiss committed Aug 18, 2023
2 parents 3441fe6 + 02b0e28 commit 9a51215
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/Core/InputCommon/InputConfig.cpp
Expand Up @@ -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
}
Expand Down

0 comments on commit 9a51215

Please sign in to comment.