From bbfaa0e99e3b0d63ac9047fc4c342729439283ef Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 27 Aug 2022 11:10:28 +0100 Subject: [PATCH] Revert continuous hold attempt - Does not function with controllers that don't produce continuous joystick events on hold, as testing unfortunately made clear. - The entire thing would need to be rewritten to make up for that, and I don't have the time to invest that kind of energy into version 1. - An unreliable feature is worse than no feature at all. --- src/m_menu.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 5d1e35ee..de0e0f41 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2585,13 +2585,11 @@ boolean M_Responder(event_t *ev) { if (Joystick.bGamepadStyle || abs(ev->data3) > jydeadzone) { - if (joywaity < thistime) + if (joywaity < thistime + && (pjoyy == 0 || (ev->data3 < 0) != (pjoyy < 0))) // no previous direction OR change direction { ch = (ev->data3 < 0) ? KEY_UPARROW : KEY_DOWNARROW; - joywaity = thistime; - if (pjoyy == 0 // no previous input? - || ((ev->data3 < 0) == (pjoyy < 0))) // same direction as the current one? - joywaity += NEWTICRATE/7; + joywaity = thistime + NEWTICRATE/7; } pjoyy = ev->data3; } @@ -2603,13 +2601,11 @@ boolean M_Responder(event_t *ev) { if (Joystick.bGamepadStyle || abs(ev->data2) > jxdeadzone) { - if (joywaity < thistime) + if (joywaitx < thistime + && (pjoyx == 0 || (ev->data2 < 0) != (pjoyx < 0))) // no previous direction OR change direction { ch = (ev->data2 < 0) ? KEY_LEFTARROW : KEY_RIGHTARROW; - joywaity = thistime; - if (pjoyx == 0 // no previous input? - || ((ev->data2 < 0) == (pjoyx < 0))) // same direction as the current one? - joywaity += NEWTICRATE/7; + joywaitx = thistime + NEWTICRATE/7; } pjoyx = ev->data2; } @@ -2636,7 +2632,7 @@ boolean M_Responder(event_t *ev) if (Joystick.bGamepadStyle || retaxis > jacceldeadzone) { - if (joywaitaccel < thistime && retaxis >= pjoyaccel) // only on upwards event + if (joywaitaccel < thistime && retaxis > pjoyaccel) // only on upwards event { ch = KEY_ENTER; joywaitaccel = thistime + NEWTICRATE/3;