Poll sliders in joypad dinput driver

Poll sliders position as additional axes in the directinput joypad driver
This commit is contained in:
Marco Bonardo 2015-11-19 00:03:14 +01:00 committed by Marco bonardo
parent 9376e8f019
commit 03f0c0339d

View File

@ -179,7 +179,7 @@ static const char *dinput_joypad_name(unsigned pad)
static int32_t dinput_joypad_vid(unsigned pad)
{
return g_pads[pad].vid;
return g_pads[pad].vid;
}
static int32_t dinput_joypad_pid(unsigned pad)
@ -377,12 +377,12 @@ static int16_t dinput_joypad_axis(unsigned port_num, uint32_t joyaxis)
if (!pad->joypad)
return 0;
if (AXIS_NEG_GET(joyaxis) <= 5)
if (AXIS_NEG_GET(joyaxis) <= 7)
{
axis = AXIS_NEG_GET(joyaxis);
is_neg = true;
}
else if (AXIS_POS_GET(joyaxis) <= 5)
else if (AXIS_POS_GET(joyaxis) <= 7)
{
axis = AXIS_POS_GET(joyaxis);
is_pos = true;
@ -408,6 +408,12 @@ static int16_t dinput_joypad_axis(unsigned port_num, uint32_t joyaxis)
case 5:
val = pad->joy_state.lRz;
break;
case 6:
val = pad->joy_state.rglSlider[0];
break;
case 7:
val = pad->joy_state.rglSlider[1];
break;
}
if (is_neg && val > 0)