From 1218db02f50d3ca9b7e6a624a9a1cbd06b35446f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 6 Apr 2013 20:17:36 -0700 Subject: [PATCH] Skip pads if their analog is not set. Not sure if a deadzone is needed... or if some pads may do a constant bottom left or something... --- Windows/DinputDevice.cpp | 2 ++ Windows/InputDevice.cpp | 2 +- Windows/XinputDevice.cpp | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Windows/DinputDevice.cpp b/Windows/DinputDevice.cpp index 5b76d0c59..17f70c82e 100644 --- a/Windows/DinputDevice.cpp +++ b/Windows/DinputDevice.cpp @@ -150,6 +150,8 @@ int DinputDevice::UpdateState(InputState &input_state) } } + if (js.lX != 0.0f || js.lY != 0.0f) + return UPDATESTATE_SKIP_NEXT; return 0; } diff --git a/Windows/InputDevice.cpp b/Windows/InputDevice.cpp index b4ed5d8c7..8c1aa7eab 100644 --- a/Windows/InputDevice.cpp +++ b/Windows/InputDevice.cpp @@ -8,8 +8,8 @@ #define PUSH_BACK(Cls) do { list.push_back(std::shared_ptr(new Cls())); } while (0) std::list> getInputDevices() { std::list> list; - PUSH_BACK(KeyboardDevice); PUSH_BACK(XinputDevice); PUSH_BACK(DinputDevice); + PUSH_BACK(KeyboardDevice); return list; } diff --git a/Windows/XinputDevice.cpp b/Windows/XinputDevice.cpp index e27970381..cecd2680f 100644 --- a/Windows/XinputDevice.cpp +++ b/Windows/XinputDevice.cpp @@ -55,7 +55,9 @@ int XinputDevice::UpdateState(InputState &input_state) { // If there's an XInput pad, skip following pads. This prevents DInput and XInput // from colliding. - return UPDATESTATE_SKIP_NEXT; + if (left.x != 0.0f || left.y != 0.0f) + return UPDATESTATE_SKIP_NEXT; + return 0; } else { // wait check_delay frames before polling the controller again this->gamepad_idx = -1;