From 80a64430a39f306f702766525a093ac1141f7252 Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 13 Oct 2017 22:10:53 +0200 Subject: 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) --- src/osd/modules/input/input_xinput.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/osd/modules/input/input_xinput.cpp') diff --git a/src/osd/modules/input/input_xinput.cpp b/src/osd/modules/input/input_xinput.cpp index e6ecdd4d177..fe5b50ec128 100644 --- a/src/osd/modules/input/input_xinput.cpp +++ b/src/osd/modules/input/input_xinput.cpp @@ -131,8 +131,7 @@ 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.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); + gamepad.z_axis = normalize_absolute_axis(xinput_state.xstate.Gamepad.bLeftTrigger - xinput_state.xstate.Gamepad.bRightTrigger, -255, 255); } void xinput_joystick_device::reset() @@ -179,16 +178,10 @@ void xinput_joystick_device::configure() } device()->add_item( - "Left Trigger", + "Z", ITEM_ID_ZAXIS, generic_axis_get_state, - &gamepad.left_trigger); - - device()->add_item( - "Right Trigger", - ITEM_ID_RZAXIS, - generic_axis_get_state, - &gamepad.right_trigger); + &gamepad.z_axis); m_configured = true; } -- cgit v1.2.3