Add evdev controller interface

This commit is contained in:
Connor McLaughlin
2021-02-07 21:32:59 +10:00
parent ee3aa0dc4d
commit 53fb55ff15
5 changed files with 503 additions and 0 deletions

View File

@ -95,6 +95,9 @@ static constexpr std::array<const char*, static_cast<u32>(ControllerInterface::B
// Deliberately not translated as it's not exposed to users.
"Android",
#endif
#ifdef WITH_EVDEV
TRANSLATABLE("ControllerInterface", "Evdev"),
#endif
}};
std::optional<ControllerInterface::Backend> ControllerInterface::ParseBackendName(const char* name)
@ -132,6 +135,9 @@ ControllerInterface::Backend ControllerInterface::GetDefaultBackend()
#include "dinput_controller_interface.h"
#include "xinput_controller_interface.h"
#endif
#ifdef WITH_EVDEV
#include "evdev_controller_interface.h"
#endif
std::unique_ptr<ControllerInterface> ControllerInterface::Create(Backend type)
{
@ -145,6 +151,10 @@ std::unique_ptr<ControllerInterface> ControllerInterface::Create(Backend type)
if (type == Backend::DInput)
return std::make_unique<DInputControllerInterface>();
#endif
#ifdef WITH_EVDEV
if (type == Backend::Evdev)
return std::make_unique<EvdevControllerInterface>();
#endif
return {};
}