From 02b0e287cb3c135fa2cf0cadaf9d0847bbcdf7b9 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 1 Aug 2023 19:33:52 +0200 Subject: [PATCH] InputConfig: Update IsControllerControlledByGamepadDevice for Android input overhaul This only matters for analytics, but still. --- Source/Core/InputCommon/InputConfig.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/InputCommon/InputConfig.cpp b/Source/Core/InputCommon/InputConfig.cpp index 64610ba768..f372fa3c1f 100644 --- a/Source/Core/InputCommon/InputConfig.cpp +++ b/Source/Core/InputCommon/InputConfig.cpp @@ -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 }