diff options
| author | JosJuice <josjuice@gmail.com> | 2022-09-16 23:02:30 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2023-03-03 22:28:23 +0100 |
| commit | 36acb17700554f0789d8650b7fba77ac8a7796b6 (patch) | |
| tree | 7786e016e53de7dd5b85139411b82cbd9d94a6c6 /Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp | |
| parent | 5e51b56d723cdd69bbe1eee39e53accfe609a812 (diff) | |
ControllerInterface/Android: Implement sensor input for InputDevices
This functionality was added in Android 12 to let apps get motion data
for gamepads.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/CoreDevice.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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<Device> DeviceContainer::FindDevice(const DeviceQualifier& devq) return nullptr; } +std::vector<std::shared_ptr<Device>> DeviceContainer::GetAllDevices() const +{ + std::lock_guard lk(m_devices_mutex); + + std::vector<std::shared_ptr<Device>> devices; + + for (const auto& d : m_devices) + devices.emplace_back(d); + + return devices; +} + std::vector<std::string> DeviceContainer::GetAllDeviceStrings() const { std::lock_guard lk(m_devices_mutex); |
