make menu respond to joystick axis events without joyscale having to be 0

This commit is contained in:
Monster Iestyn 2018-12-02 21:18:28 +00:00 committed by mazmazz
parent 591fd8d6db
commit 9ea0df0986

View file

@ -2116,26 +2116,32 @@ boolean M_Responder(event_t *ev)
{ {
if (ev->type == ev_joystick && ev->data1 == 0 && joywait < I_GetTime()) if (ev->type == ev_joystick && ev->data1 == 0 && joywait < I_GetTime())
{ {
if (ev->data3 == -1) if (ev->data3 != INT32_MAX)
{ {
ch = KEY_UPARROW; if (ev->data3 < 0)
joywait = I_GetTime() + NEWTICRATE/7; {
} ch = KEY_UPARROW;
else if (ev->data3 == 1) joywait = I_GetTime() + NEWTICRATE/7;
{ }
ch = KEY_DOWNARROW; else if (ev->data3 > 0)
joywait = I_GetTime() + NEWTICRATE/7; {
ch = KEY_DOWNARROW;
joywait = I_GetTime() + NEWTICRATE/7;
}
} }
if (ev->data2 == -1) if (ev->data2 != INT32_MAX)
{ {
ch = KEY_LEFTARROW; if (ev->data2 < 0)
joywait = I_GetTime() + NEWTICRATE/17; {
} ch = KEY_LEFTARROW;
else if (ev->data2 == 1) joywait = I_GetTime() + NEWTICRATE/17;
{ }
ch = KEY_RIGHTARROW; else if (ev->data2 > 0)
joywait = I_GetTime() + NEWTICRATE/17; {
ch = KEY_RIGHTARROW;
joywait = I_GetTime() + NEWTICRATE/17;
}
} }
} }
else if (ev->type == ev_mouse && mousewait < I_GetTime()) else if (ev->type == ev_mouse && mousewait < I_GetTime())