mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-20 16:31:03 +00:00
Merge branch 'controller-fixes' into 'next'
Various controller fixes Closes #936 and #937 See merge request STJr/SRB2!1914
This commit is contained in:
commit
71736f358f
2 changed files with 13 additions and 5 deletions
|
@ -543,9 +543,9 @@ INT32 G_RemapGamepadEvent(event_t *event, INT32 *type)
|
|||
const INT16 value = G_GetGamepadAxisValue(event->which, event->key);
|
||||
|
||||
if (value < -jdeadzone || value > jdeadzone)
|
||||
*type = ev_keyup;
|
||||
else
|
||||
*type = ev_keydown;
|
||||
else
|
||||
*type = ev_keyup;
|
||||
|
||||
if (value < -jdeadzone)
|
||||
return KEY_INV_AXES + event->key;
|
||||
|
|
14
src/m_menu.c
14
src/m_menu.c
|
@ -3224,6 +3224,7 @@ boolean M_Responder(event_t *ev)
|
|||
static INT32 pjoyx = 0, pjoyy = 0;
|
||||
static INT32 pmousex = 0, pmousey = 0;
|
||||
static INT32 lastx = 0, lasty = 0;
|
||||
boolean shouldswallowevent = false;
|
||||
void (*routine)(INT32 choice); // for some casting problem
|
||||
|
||||
if (dedicated || (demoplayback && titledemo)
|
||||
|
@ -3239,11 +3240,18 @@ boolean M_Responder(event_t *ev)
|
|||
|
||||
boolean useEventHandler = false;
|
||||
|
||||
if (menuactive && ev->type == ev_gamepad_axis && ev->which == 0)
|
||||
{
|
||||
// ALWAYS swallow gamepad axis events, to prevent trickling down to game input
|
||||
// this applies even if the axis event does not get remapped
|
||||
shouldswallowevent = true;
|
||||
}
|
||||
|
||||
if (noFurtherInput)
|
||||
{
|
||||
// Ignore input after enter/escape/other buttons
|
||||
// (but still allow shift keyup so caps doesn't get stuck)
|
||||
return false;
|
||||
return shouldswallowevent;
|
||||
}
|
||||
else if (menuactive)
|
||||
{
|
||||
|
@ -3368,7 +3376,7 @@ boolean M_Responder(event_t *ev)
|
|||
}
|
||||
|
||||
if (!useEventHandler && ch == -1)
|
||||
return false;
|
||||
return shouldswallowevent;
|
||||
else if (ch == gamecontrol[GC_SYSTEMMENU][0] || ch == gamecontrol[GC_SYSTEMMENU][1]) // allow remappable ESC key
|
||||
ch = KEY_ESCAPE;
|
||||
|
||||
|
@ -3601,7 +3609,7 @@ boolean M_Responder(event_t *ev)
|
|||
//currentMenu->lastOn = itemOn;
|
||||
//if (currentMenu->prevMenu)
|
||||
// M_SetupNextMenu(currentMenu->prevMenu);
|
||||
return false;
|
||||
return shouldswallowevent;
|
||||
|
||||
default:
|
||||
CON_Responder(ev);
|
||||
|
|
Loading…
Reference in a new issue