Skip to content

Commit

Permalink
Menu: Trigger scroll home+end on keyup (#17171)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonninnos authored Nov 7, 2024
1 parent e45bc85 commit 522efc3
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions menu/menu_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -5571,6 +5571,7 @@ unsigned menu_event(
else
{
static uint8_t switch_old = 0;
static bool down[MENU_ACTION_TOGGLE] = {false};
uint8_t switch_current = BIT256_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_LEFT)
| BIT256_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_RIGHT);
uint8_t switch_trigger = switch_current & ~switch_old;
Expand Down Expand Up @@ -5646,11 +5647,24 @@ unsigned menu_event(
menu_st->scroll.mode = (swap_scroll_btns) ? MENU_SCROLL_PAGE : MENU_SCROLL_START_LETTER;
ret = MENU_ACTION_SCROLL_DOWN;
}
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_L3))

if (BIT256_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_L3))
down[MENU_ACTION_SCROLL_HOME] = true;
else if (down[MENU_ACTION_SCROLL_HOME])
{
down[MENU_ACTION_SCROLL_HOME] = false;
ret = MENU_ACTION_SCROLL_HOME;
else if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_R3))
}

if (BIT256_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_R3))
down[MENU_ACTION_SCROLL_END] = true;
else if (down[MENU_ACTION_SCROLL_END])
{
down[MENU_ACTION_SCROLL_END] = false;
ret = MENU_ACTION_SCROLL_END;
else if (ok_trigger)
}

if (ok_trigger)
ret = MENU_ACTION_OK;
else if (BIT256_GET_PTR(p_trigger_input, menu_cancel_btn))
ret = MENU_ACTION_CANCEL;
Expand Down

0 comments on commit 522efc3

Please sign in to comment.