mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 06:40:18 +00:00
Poll sliders in joypad dinput driver
Poll sliders position as additional axes in the directinput joypad driver
This commit is contained in:
parent
9376e8f019
commit
03f0c0339d
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user