summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/input/input_xinput.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-10-13 19:25:43 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-10-13 19:25:43 -0400
commit9308ed99dcf4db9a6a0ff3ea6b423a6be0ba32bf (patch)
tree321d1761723f110d60d3716173d3a5b757f85411 /src/osd/modules/input/input_xinput.cpp
parentd301c90c7bfa2628a22c54441eba520dd64c659a (diff)
Revert "xinput: the left+right triggers combined are considered the Z Axis, not Z Axis+Z Rotation where the axis resting position was at the middle of the trigger (nw)"
The DirectInput Z-axis trigger merger seems more widely considered a bug than a feature, and probably should not be the default MAME behavior. This reverts commit 80a64430a39f306f702766525a093ac1141f7252.
Diffstat (limited to 'src/osd/modules/input/input_xinput.cpp')
-rw-r--r--src/osd/modules/input/input_xinput.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/osd/modules/input/input_xinput.cpp b/src/osd/modules/input/input_xinput.cpp
index fe5b50ec128..e6ecdd4d177 100644
--- a/src/osd/modules/input/input_xinput.cpp
+++ b/src/osd/modules/input/input_xinput.cpp
@@ -131,7 +131,8 @@ void xinput_joystick_device::poll()
gamepad.right_thumb_y = normalize_absolute_axis(-xinput_state.xstate.Gamepad.sThumbRY, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE);
// Now the triggers
- gamepad.z_axis = normalize_absolute_axis(xinput_state.xstate.Gamepad.bLeftTrigger - xinput_state.xstate.Gamepad.bRightTrigger, -255, 255);
+ gamepad.left_trigger = normalize_absolute_axis(xinput_state.xstate.Gamepad.bLeftTrigger, 0, 255);
+ gamepad.right_trigger = normalize_absolute_axis(xinput_state.xstate.Gamepad.bRightTrigger, 0, 255);
}
void xinput_joystick_device::reset()
@@ -178,10 +179,16 @@ void xinput_joystick_device::configure()
}
device()->add_item(
- "Z",
+ "Left Trigger",
ITEM_ID_ZAXIS,
generic_axis_get_state<LONG>,
- &gamepad.z_axis);
+ &gamepad.left_trigger);
+
+ device()->add_item(
+ "Right Trigger",
+ ITEM_ID_RZAXIS,
+ generic_axis_get_state<LONG>,
+ &gamepad.right_trigger);
m_configured = true;
}