Skip to content

Commit

Permalink
Fixed the management of UP+DOWN and LEFT+RIGHT (#317).
Browse files Browse the repository at this point in the history
  • Loading branch information
punesemu committed Oct 17, 2023
1 parent 71e7143 commit c63dd55
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/core/input/standard_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c63dd55

Please sign in to comment.