Merge pull request #2627 from thedax/rightStickBindOption

Add option to bind right analog stick to left/right dpad buttons only.
This commit is contained in:
Henrik Rydgård 2013-07-05 12:14:25 -07:00
commit 39891eb9a6
2 changed files with 8 additions and 0 deletions

View File

@ -237,6 +237,10 @@ int DinputDevice::UpdateState(InputState &input_state)
if (js.lZ > rthreshold) input_state.pad_buttons |= PAD_BUTTON_Y;
else if (js.lZ < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_A;
break;
case 5:
if (js.lRz > rthreshold) input_state.pad_buttons |= PAD_BUTTON_RIGHT;
else if (js.lRz < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_LEFT;
break;
}
return UPDATESTATE_SKIP_PAD;

View File

@ -199,6 +199,10 @@ void XinputDevice::ApplyDiff(XINPUT_STATE &state, InputState &input_state) {
if (state.Gamepad.sThumbRY > rthreshold) input_state.pad_buttons |= PAD_BUTTON_Y;
else if (state.Gamepad.sThumbRY < -rthreshold) input_state.pad_buttons |= PAD_BUTTON_A;
break;
case 5:
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;
break;
}
}