FrontendCommon: Add DInput controller interface

Still needs force feedback/vibration support.
This commit is contained in:
Connor McLaughlin
2020-12-29 16:29:30 +10:00
parent a3e4c61a0b
commit 0945744f9b
7 changed files with 561 additions and 1 deletions

View File

@ -89,6 +89,7 @@ static constexpr std::array<const char*, static_cast<u32>(ControllerInterface::B
#endif
#ifdef WIN32
TRANSLATABLE("ControllerInterface", "XInput"),
TRANSLATABLE("ControllerInterface", "DInput"),
#endif
}};
@ -124,6 +125,7 @@ ControllerInterface::Backend ControllerInterface::GetDefaultBackend()
#include "sdl_controller_interface.h"
#endif
#ifdef WIN32
#include "dinput_controller_interface.h"
#include "xinput_controller_interface.h"
#endif
@ -136,6 +138,8 @@ std::unique_ptr<ControllerInterface> ControllerInterface::Create(Backend type)
#ifdef WIN32
if (type == Backend::XInput)
return std::make_unique<XInputControllerInterface>();
if (type == Backend::DInput)
return std::make_unique<DInputControllerInterface>();
#endif
return {};