diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2014-08-31 22:41:33 -0700 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2014-09-01 14:56:11 -0700 |
| commit | 3c0227445cb75f2798d8bcf1d284566c16f6f940 (patch) | |
| tree | 44307ca5c9eec28c4f3889ca1dff89f126a97e55 /Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp | |
| parent | b026217984d1098592083773f249e8afa3a1669d (diff) | |
Revert changes to how DInput filters out XInput devices.
This is to remain compatible with XBCD devices.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp index 7d1db57427..1ff48877db 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp @@ -8,6 +8,7 @@ #include "InputCommon/ControllerInterface/DInput/DInput.h" #include "InputCommon/ControllerInterface/DInput/DInputJoystick.h" +#include "InputCommon/ControllerInterface/DInput/XInputFilter.h" namespace ciface { @@ -16,29 +17,22 @@ namespace DInput #define DATA_BUFFER_SIZE 32 -static const GUID s_known_xinput_guids[] = { - // ValveStreamingGamepad - { MAKELONG(0x28DE, 0x11FF), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } }, - // IID_X360WiredGamepad - { MAKELONG(0x045E, 0x02A1), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } }, - // IID_X360WirelessGamepad - { MAKELONG(0x045E, 0x028E), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } }, -}; - void InitJoystick(IDirectInput8* const idi8, std::vector<Core::Device*>& devices, HWND hwnd) { std::list<DIDEVICEINSTANCE> joysticks; - idi8->EnumDevices( DI8DEVCLASS_GAMECTRL, DIEnumDevicesCallback, (LPVOID)&joysticks, DIEDFL_ATTACHEDONLY ); + idi8->EnumDevices(DI8DEVCLASS_GAMECTRL, DIEnumDevicesCallback, (LPVOID)&joysticks, DIEDFL_ATTACHEDONLY); // this is used to number the joysticks // multiple joysticks with the same name shall get unique ids starting at 0 std::map< std::basic_string<TCHAR>, int> name_counts; + std::vector<DWORD> xinput_guids; + GetXInputGUIDS(&xinput_guids); + for (DIDEVICEINSTANCE& joystick : joysticks) { // skip XInput Devices - if (std::find(std::begin(s_known_xinput_guids), std::end(s_known_xinput_guids), - joystick.guidProduct) != std::end(s_known_xinput_guids)) + if (std::find(xinput_guids.begin(), xinput_guids.end(), joystick.guidProduct.Data1) != xinput_guids.end()) { continue; } |
