summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/input/input_xinput.cpp
diff options
context:
space:
mode:
author Brad Hughes <bradhugh@outlook.com>2016-04-06 09:44:02 -0400
committer Brad Hughes <bradhugh@outlook.com>2016-04-06 09:44:02 -0400
commita0ba9bc8c742bcd41a135fec2e92c2e98a081a7c (patch)
tree55e577ee38f0dab1a56633586a8f831509a22d3b /src/osd/modules/input/input_xinput.cpp
parent69f5a2dcc82d18ad80c9dec31d83fb266d3bc337 (diff)
Make Xinput triggers analog
Diffstat (limited to 'src/osd/modules/input/input_xinput.cpp')
-rw-r--r--src/osd/modules/input/input_xinput.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/osd/modules/input/input_xinput.cpp b/src/osd/modules/input/input_xinput.cpp
index 753fd49a729..bee464054f1 100644
--- a/src/osd/modules/input/input_xinput.cpp
+++ b/src/osd/modules/input/input_xinput.cpp
@@ -155,8 +155,8 @@ void xinput_joystick_device::poll()
gamepad.sThumbRY = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbRY * -1, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE);
// Now the triggers
- gamepad.bLeftTrigger = xinput_state.xstate.Gamepad.bLeftTrigger;
- gamepad.bRightTrigger = xinput_state.xstate.Gamepad.bRightTrigger;
+ gamepad.bLeftTrigger = normalize_absolute_axis(xinput_state.xstate.Gamepad.bLeftTrigger, 0, 0xFF);
+ gamepad.bRightTrigger = normalize_absolute_axis(xinput_state.xstate.Gamepad.bRightTrigger, 0, 0xFF);
}
void xinput_joystick_device::reset()
@@ -204,14 +204,14 @@ void xinput_joystick_device::configure()
device()->add_item(
"Left Trigger",
- static_cast<input_item_id>(ITEM_ID_BUTTON1 + XINPUT_MAX_BUTTONS),
- generic_button_get_state,
+ ITEM_ID_OTHER_AXIS_ABSOLUTE,
+ generic_axis_get_state,
&gamepad.bLeftTrigger);
device()->add_item(
"Right Trigger",
- static_cast<input_item_id>(ITEM_ID_BUTTON1 + XINPUT_MAX_BUTTONS + 1),
- generic_button_get_state,
+ ITEM_ID_OTHER_AXIS_ABSOLUTE,
+ generic_axis_get_state,
&gamepad.bRightTrigger);
m_configured = true;