Make M_Responder respond to joy buttons only in-menu (multiplayer bug?)

This commit is contained in:
mazmazz 2018-12-03 03:33:12 -05:00
parent 6dd44ca1de
commit 6bf31492b7

View file

@ -2079,44 +2079,44 @@ boolean M_Responder(event_t *ev)
// (but still allow shift keyup so caps doesn't get stuck) // (but still allow shift keyup so caps doesn't get stuck)
return false; return false;
} }
else if (ev->type == ev_keydown)
{
ch = ev->data1;
// added 5-2-98 remap virtual keys (mouse & joystick buttons)
switch (ch)
{
case KEY_MOUSE1:
case KEY_JOY1:
ch = KEY_ENTER;
break;
case KEY_JOY1 + 3:
ch = 'n';
break;
case KEY_MOUSE1 + 1:
case KEY_JOY1 + 1:
ch = KEY_ESCAPE;
break;
case KEY_JOY1 + 2:
ch = KEY_BACKSPACE;
break;
case KEY_HAT1:
ch = KEY_UPARROW;
break;
case KEY_HAT1 + 1:
ch = KEY_DOWNARROW;
break;
case KEY_HAT1 + 2:
ch = KEY_LEFTARROW;
break;
case KEY_HAT1 + 3:
ch = KEY_RIGHTARROW;
break;
}
}
else if (menuactive) else if (menuactive)
{ {
if (ev->type == ev_joystick && ev->data1 == 0 && joywait < I_GetTime()) if (ev->type == ev_keydown)
{
ch = ev->data1;
// added 5-2-98 remap virtual keys (mouse & joystick buttons)
switch (ch)
{
case KEY_MOUSE1:
case KEY_JOY1:
ch = KEY_ENTER;
break;
case KEY_JOY1 + 3:
ch = 'n';
break;
case KEY_MOUSE1 + 1:
case KEY_JOY1 + 1:
ch = KEY_ESCAPE;
break;
case KEY_JOY1 + 2:
ch = KEY_BACKSPACE;
break;
case KEY_HAT1:
ch = KEY_UPARROW;
break;
case KEY_HAT1 + 1:
ch = KEY_DOWNARROW;
break;
case KEY_HAT1 + 2:
ch = KEY_LEFTARROW;
break;
case KEY_HAT1 + 3:
ch = KEY_RIGHTARROW;
break;
}
}
else if (ev->type == ev_joystick && ev->data1 == 0 && joywait < I_GetTime())
{ {
if (ev->data3 == -1) if (ev->data3 == -1)
{ {