From 36acb17700554f0789d8650b7fba77ac8a7796b6 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 16 Sep 2022 23:02:30 +0200 Subject: ControllerInterface/Android: Implement sensor input for InputDevices This functionality was added in Android 12 to let apps get motion data for gamepads. --- Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (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 4e46179fc6..222791f03f 100644 --- a/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp +++ b/Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp @@ -242,6 +242,18 @@ std::shared_ptr DeviceContainer::FindDevice(const DeviceQualifier& devq) return nullptr; } +std::vector> DeviceContainer::GetAllDevices() const +{ + std::lock_guard lk(m_devices_mutex); + + std::vector> devices; + + for (const auto& d : m_devices) + devices.emplace_back(d); + + return devices; +} + std::vector DeviceContainer::GetAllDeviceStrings() const { std::lock_guard lk(m_devices_mutex); -- cgit v1.2.3