From ac907ef977a1dc2ae4a7acc1ca9f56f1ea21d9cf Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sat, 16 Nov 2019 15:40:43 -0600 Subject: ControllerInterface: Combine evdev devices with the same unique ID. This works around Linux drivers for DS4 (Playstation 4) controllers splitting the device into three separate event nodes which makes configuration difficult. To prevent collisions of input names in combined devices more descriptive names are now used when possible. --- .../InputCommon/ControllerInterface/evdev/evdev.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/evdev/evdev.h') diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.h b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.h index f4b095558b..3c60e2cb57 100644 --- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.h +++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.h @@ -76,18 +76,26 @@ public: void UpdateInput() override; bool IsValid() const override; - evdevDevice(const std::string& devnode); ~evdevDevice(); + // Return true if node was "interesting". + bool AddNode(std::string devnode, int fd, libevdev* dev); + + const char* GetUniqueID() const; + std::string GetName() const override { return m_name; } std::string GetSource() const override { return "evdev"; } - bool IsInteresting() const { return m_interesting; } private: - const std::string m_devfile; - int m_fd; - libevdev* m_dev; std::string m_name; - bool m_interesting = false; + + struct Node + { + std::string devnode; + int fd; + libevdev* device; + }; + + std::vector m_nodes; }; } // namespace ciface::evdev -- cgit v1.2.3