Merge pull request #2315 from gizmo98/analog-dpad-sanity-check
input: add sanity check for analog dpad mode
This commit is contained in:
commit
9a4adece0f
|
@ -457,12 +457,28 @@ void input_push_analog_dpad(struct retro_keybind *binds, unsigned mode)
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case ANALOG_DPAD_LSTICK:
|
case ANALOG_DPAD_LSTICK:
|
||||||
j = RARCH_ANALOG_LEFT_X_PLUS + 3;
|
/* check if analog left is defined. *
|
||||||
inherit_joyaxis = true;
|
* if plus and minus are equal abort. */
|
||||||
|
if (!((binds[RARCH_ANALOG_LEFT_X_PLUS].joyaxis ==
|
||||||
|
binds[RARCH_ANALOG_LEFT_X_MINUS].joyaxis) ||
|
||||||
|
(binds[RARCH_ANALOG_LEFT_Y_PLUS].joyaxis ==
|
||||||
|
binds[RARCH_ANALOG_LEFT_Y_MINUS].joyaxis)))
|
||||||
|
{
|
||||||
|
j = RARCH_ANALOG_LEFT_X_PLUS + 3;
|
||||||
|
inherit_joyaxis = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ANALOG_DPAD_RSTICK:
|
case ANALOG_DPAD_RSTICK:
|
||||||
j = RARCH_ANALOG_RIGHT_X_PLUS + 3;
|
/* check if analog right is defined. *
|
||||||
inherit_joyaxis = true;
|
* if plus and minus are equal abort. */
|
||||||
|
if (!((binds[RARCH_ANALOG_RIGHT_X_PLUS].joyaxis ==
|
||||||
|
binds[RARCH_ANALOG_RIGHT_X_MINUS].joyaxis) ||
|
||||||
|
(binds[RARCH_ANALOG_RIGHT_Y_PLUS].joyaxis ==
|
||||||
|
binds[RARCH_ANALOG_RIGHT_Y_MINUS].joyaxis)))
|
||||||
|
{
|
||||||
|
j = RARCH_ANALOG_RIGHT_X_PLUS + 3;
|
||||||
|
inherit_joyaxis = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue