From 516c1314d2e08a81aa707566265597d82591e22c Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 16 Mar 2025 11:05:06 +0100 Subject: Android: Don't use separate thread for MotionAlertDialog This is an Android continuation of bc95c00. We now call InputDetector::Update immediately after receiving an input event from Android instead of periodically calling it in a sleep loop. This improves detection of very short inputs, which are especially likely to occur for volume buttons on phones (or at least on my phone) if you don't intentionally keep them held down. --- .../InputCommon/ControllerInterface/CoreDevice.cpp | 23 ---------------------- 1 file changed, 23 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp b/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp index 3a29d4c98f..5a370cadc8 100644 --- a/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp +++ b/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp @@ -335,29 +335,6 @@ bool DeviceContainer::HasConnectedDevice(const DeviceQualifier& qualifier) const return device != nullptr && device->IsValid(); } -// Wait for inputs on supplied devices. -// Inputs are only considered if they are first seen in a neutral state. -// This is useful for crazy flightsticks that have certain buttons that are always held down -// and also properly handles detection when using "FullAnalogSurface" inputs. -// Multiple detections are returned until the various timeouts have been reached. -auto DeviceContainer::DetectInput(const std::vector& device_strings, - std::chrono::milliseconds initial_wait, - std::chrono::milliseconds confirmation_wait, - std::chrono::milliseconds maximum_wait) const - -> std::vector -{ - InputDetector input_detector; - input_detector.Start(*this, device_strings); - - while (!input_detector.IsComplete()) - { - Common::SleepCurrentThread(10); - input_detector.Update(initial_wait, confirmation_wait, maximum_wait); - } - - return input_detector.TakeResults(); -} - struct InputDetector::Impl { struct InputState -- cgit v1.2.3