Add hotplug support to DInput and XInput controller backends

This commit is contained in:
Michael M
2017-11-10 12:30:37 -08:00
committed by Jordan Woyak
parent 92ca6e124e
commit d26c1ce24d
5 changed files with 123 additions and 10 deletions

View File

@ -46,6 +46,8 @@ std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device)
void PopulateDevices(HWND hwnd)
{
g_controller_interface.RemoveDevice([](const auto* dev) { return dev->GetSource() == "DInput"; });
IDirectInput8* idi8;
if (FAILED(DirectInput8Create(GetModuleHandle(nullptr), DIRECTINPUT_VERSION, IID_IDirectInput8,
(LPVOID*)&idi8, nullptr)))