diff options
| author | Tilka <tilkax@gmail.com> | 2024-04-13 11:56:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-13 11:56:27 +0100 |
| commit | e62d8ecfa8c104f73c4feafc79f7ff64b4a4fd7b (patch) | |
| tree | b9046d845233c8503e6652241617460f5ad4b0ee /Source/Core/InputCommon/ControllerInterface/Pipes | |
| parent | 1bfeeb8a631bf3ad3d357b3c920ca8e8a456344e (diff) | |
| parent | a9a9fdd9e903d47ec83aa7385e7be54871abbf0b (diff) | |
Merge pull request #12632 from jordan-woyak/input-backend-impls
Implement missing InputBackend classes.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Pipes')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp | 14 | ||||
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.h | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp b/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp index af7ad7dc6f..1a2052089e 100644 --- a/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp @@ -39,7 +39,19 @@ static double StringToDouble(const std::string& text) return result; } -void PopulateDevices() +class InputBackend final : public ciface::InputBackend +{ +public: + using ciface::InputBackend::InputBackend; + void PopulateDevices() override; +}; + +std::unique_ptr<ciface::InputBackend> CreateInputBackend(ControllerInterface* controller_interface) +{ + return std::make_unique<InputBackend>(controller_interface); +} + +void InputBackend::PopulateDevices() { // Search the Pipes directory for files that we can open in read-only, // non-blocking mode. The device name is the virtual name of the file. diff --git a/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.h b/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.h index 53fefd0cb5..857d5e8128 100644 --- a/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.h +++ b/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.h @@ -21,7 +21,7 @@ namespace ciface::Pipes // SET {L, R} [0, 1] // SET {MAIN, C} [0, 1] [0, 1] -void PopulateDevices(); +std::unique_ptr<ciface::InputBackend> CreateInputBackend(ControllerInterface* controller_interface); class PipeDevice : public Core::Device { |
