summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2025-03-16 11:05:06 +0100
committerJosJuice <josjuice@gmail.com>2025-03-23 21:39:04 +0100
commit516c1314d2e08a81aa707566265597d82591e22c (patch)
tree6412ab67ada4d97456772b96bdbe68ac6f104540 /Source/Core/InputCommon/ControllerInterface/CoreDevice.h
parent1515cf6ccdd1ba206c8e0eaabad07de28a4f5939 (diff)
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.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/CoreDevice.h')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/CoreDevice.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
index 54d7b46110..f30dd4f405 100644
--- a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
+++ b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
@@ -230,20 +230,20 @@ public:
bool HasConnectedDevice(const DeviceQualifier& qualifier) const;
- std::vector<InputDetection> DetectInput(const std::vector<std::string>& device_strings,
- std::chrono::milliseconds initial_wait,
- std::chrono::milliseconds confirmation_wait,
- std::chrono::milliseconds maximum_wait) const;
-
std::recursive_mutex& GetDevicesMutex() const { return m_devices_mutex; }
protected:
// Exclusively needed when reading/writing the "m_devices" array.
- // Not needed when individually readring/writing a single device ptr.
+ // Not needed when individually reading/writing a single device ptr.
mutable std::recursive_mutex m_devices_mutex;
std::vector<std::shared_ptr<Device>> m_devices;
};
+// Wait for inputs on supplied devices.
+// Inputs are only considered if they are first seen in a neutral state.
+// This is useful for wacky flight sticks 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.
class InputDetector
{
public: