diff --git a/Windows/DinputDevice.cpp b/Windows/DinputDevice.cpp index 17f70c82eb05..beba28c668da 100644 --- a/Windows/DinputDevice.cpp +++ b/Windows/DinputDevice.cpp @@ -150,8 +150,6 @@ int DinputDevice::UpdateState(InputState &input_state) } } - if (js.lX != 0.0f || js.lY != 0.0f) - return UPDATESTATE_SKIP_NEXT; - return 0; + return UPDATESTATE_SKIP_PAD; } diff --git a/Windows/DinputDevice.h b/Windows/DinputDevice.h index 70d4f97dbd62..f703908aa2d8 100644 --- a/Windows/DinputDevice.h +++ b/Windows/DinputDevice.h @@ -27,6 +27,7 @@ class DinputDevice : DinputDevice(); ~DinputDevice(); virtual int UpdateState(InputState &input_state); + virtual bool IsPad() { return true; } private: LPDIRECTINPUT8 pDI; LPDIRECTINPUTDEVICE8 pJoystick; diff --git a/Windows/InputDevice.h b/Windows/InputDevice.h index 597f2e039539..7a8d6ab78202 100644 --- a/Windows/InputDevice.h +++ b/Windows/InputDevice.h @@ -10,8 +10,9 @@ struct InputState; class InputDevice { public: - enum { UPDATESTATE_SKIP_NEXT = 0x1234}; + enum { UPDATESTATE_SKIP_PAD = 0x1234}; virtual int UpdateState(InputState &input_state) = 0; + virtual bool IsPad() = 0; }; std::list> getInputDevices(); diff --git a/Windows/KeyboardDevice.h b/Windows/KeyboardDevice.h index b97ef13688ed..87b4d871f1d3 100644 --- a/Windows/KeyboardDevice.h +++ b/Windows/KeyboardDevice.h @@ -4,4 +4,5 @@ class KeyboardDevice : public InputDevice { public: virtual int UpdateState(InputState &input_state); + virtual bool IsPad() { return false; } }; diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 2e2fd38c8648..c414e440ac17 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -130,9 +130,15 @@ void WindowsHost::SetDebugMode(bool mode) void WindowsHost::PollControllers(InputState &input_state) { + bool doPad = true; for (auto iter = this->input.begin(); iter != this->input.end(); iter++) - if ((*iter)->UpdateState(input_state) == InputDevice::UPDATESTATE_SKIP_NEXT) - break; + { + auto device = *iter; + if (!doPad && device->IsPad()) + continue; + if (device->UpdateState(input_state) == InputDevice::UPDATESTATE_SKIP_PAD) + doPad = false; + } } void WindowsHost::BootDone() diff --git a/Windows/XinputDevice.cpp b/Windows/XinputDevice.cpp index cecd2680f4e6..34b488315537 100644 --- a/Windows/XinputDevice.cpp +++ b/Windows/XinputDevice.cpp @@ -55,9 +55,7 @@ int XinputDevice::UpdateState(InputState &input_state) { // If there's an XInput pad, skip following pads. This prevents DInput and XInput // from colliding. - if (left.x != 0.0f || left.y != 0.0f) - return UPDATESTATE_SKIP_NEXT; - return 0; + return UPDATESTATE_SKIP_PAD; } else { // wait check_delay frames before polling the controller again this->gamepad_idx = -1; diff --git a/Windows/XinputDevice.h b/Windows/XinputDevice.h index 9ed0d92d65f9..8e464de520a9 100644 --- a/Windows/XinputDevice.h +++ b/Windows/XinputDevice.h @@ -8,6 +8,7 @@ class XinputDevice : public: XinputDevice(); virtual int UpdateState(InputState &input_state); + virtual bool IsPad() { return true; } private: void ApplyDiff(XINPUT_STATE &state, InputState &input_state); int gamepad_idx;