From c63dd5552de35b96640cfe64175f13cca05516e1 Mon Sep 17 00:00:00 2001 From: Fabio Cavallo Date: Tue, 17 Oct 2023 14:39:18 +0200 Subject: [PATCH] Fixed the management of UP+DOWN and LEFT+RIGHT (#317). --- src/core/input/standard_controller.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/core/input/standard_controller.c b/src/core/input/standard_controller.c index 39a872380..65d5284d5 100644 --- a/src/core/input/standard_controller.c +++ b/src/core/input/standard_controller.c @@ -105,32 +105,16 @@ BYTE input_decode_event_standard_controller(BYTE mode, UNUSED(BYTE autorepeat), (*start) = mode; return (EXIT_OK); } else if (event == prt->input[type][UP]) { - (*up) = mode; - // non possono essere premuti contemporaneamente - if (!cfg->input.permit_updown_leftright && (mode == PRESSED)) { - (*down) = RELEASED; - } + (*up) = ((*down) == PRESSED) && !cfg->input.permit_updown_leftright ? RELEASED : mode; return (EXIT_OK); } else if (event == prt->input[type][DOWN]) { - (*down) = mode; - // non possono essere premuti contemporaneamente - if (!cfg->input.permit_updown_leftright && (mode == PRESSED)) { - (*up) = RELEASED; - } + (*down) = ((*up) == PRESSED) && !cfg->input.permit_updown_leftright ? RELEASED : mode; return (EXIT_OK); } else if (event == prt->input[type][LEFT]) { - (*left) = mode; - // non possono essere premuti contemporaneamente - if (!cfg->input.permit_updown_leftright && (mode == PRESSED)) { - (*right) = RELEASED; - } + (*left) = ((*right) == PRESSED) && !cfg->input.permit_updown_leftright ? RELEASED : mode; return (EXIT_OK); } else if (event == prt->input[type][RIGHT]) { - (*right) = mode; - // non possono essere premuti contemporaneamente - if (!cfg->input.permit_updown_leftright && (mode == PRESSED)) { - (*left) = RELEASED; - } + (*right) = ((*left) == PRESSED) && !cfg->input.permit_updown_leftright ? RELEASED : mode; return (EXIT_OK); } else if (event == prt->input[type][TRB_A]) { prt->turbo[TURBOA].mode = mode;