From 5916a345c377a102ef869d10c04513fea1fdb791 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 11 Jun 2013 20:38:21 +0200 Subject: [PATCH] Hard bind right x360 stick to buttons until we can improve control mapping functionality. Thanks KrossX. --- Windows/XinputDevice.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Windows/XinputDevice.cpp b/Windows/XinputDevice.cpp index a00f17dfa8..087c0653a6 100644 --- a/Windows/XinputDevice.cpp +++ b/Windows/XinputDevice.cpp @@ -172,7 +172,15 @@ void XinputDevice::ApplyDiff(XINPUT_STATE &state, InputState &input_state) { } } + const SHORT rthreshold = 22000; + + if (state.Gamepad.sThumbRX > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RIGHT; + else if (state.Gamepad.sThumbRX < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LEFT; + + if (state.Gamepad.sThumbRY > rthreshold) input_state.pad_buttons |= PAD_BUTTON_UP; + else if (state.Gamepad.sThumbRY < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_DOWN; } + int XinputDevice::UpdateRawStateSingle(RawInputState &rawState) { if (g_Config.iForceInputDevice > 0) return -1;