diff options
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Device.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Device.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Device.cpp b/Source/Core/InputCommon/ControllerInterface/Device.cpp index f83dae268e..48d40cb9af 100644 --- a/Source/Core/InputCommon/ControllerInterface/Device.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Device.cpp @@ -199,5 +199,11 @@ Device::Output* DeviceContainer::FindOutput(const std::string& name, const Devic { return def_dev->FindOutput(name); } + +bool DeviceContainer::HasConnectedDevice(const DeviceQualifier& qualifier) const +{ + const auto device = FindDevice(qualifier); + return device != nullptr && device->IsValid(); +} } } diff --git a/Source/Core/InputCommon/ControllerInterface/Device.h b/Source/Core/InputCommon/ControllerInterface/Device.h index 7b601cc775..5482b93ac0 100644 --- a/Source/Core/InputCommon/ControllerInterface/Device.h +++ b/Source/Core/InputCommon/ControllerInterface/Device.h @@ -158,6 +158,8 @@ public: std::string GetDefaultDeviceString() const; std::shared_ptr<Device> FindDevice(const DeviceQualifier& devq) const; + bool HasConnectedDevice(const DeviceQualifier& qualifier) const; + protected: mutable std::mutex m_devices_mutex; std::vector<std::shared_ptr<Device>> m_devices; |
