Skip to content

Commit ea86be0

Browse files
authored
Fix menu analog stick navigation (#15740)
1 parent 5dfae51 commit ea86be0

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

input/input_driver.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6170,6 +6170,13 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
61706170
int k;
61716171
int s;
61726172

6173+
/* Remember original analog D-pad binds. */
6174+
for (k = RETRO_DEVICE_ID_JOYPAD_UP; k <= RETRO_DEVICE_ID_JOYPAD_RIGHT; k++)
6175+
{
6176+
(auto_binds)[k].orig_joyaxis = (auto_binds)[k].joyaxis;
6177+
(general_binds)[k].orig_joyaxis = (general_binds)[k].joyaxis;
6178+
}
6179+
61736180
/* Read input from both analog sticks. */
61746181
for (s = RETRO_DEVICE_INDEX_ANALOG_LEFT; s <= RETRO_DEVICE_INDEX_ANALOG_RIGHT; s++)
61756182
{
@@ -6235,6 +6242,15 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
62356242
#ifdef HAVE_MENU
62366243
if (menu_is_alive)
62376244
{
6245+
int k;
6246+
6247+
/* Restore analog D-pad binds temporarily overridden. */
6248+
for (k = RETRO_DEVICE_ID_JOYPAD_UP; k <= RETRO_DEVICE_ID_JOYPAD_RIGHT; k++)
6249+
{
6250+
(auto_binds)[k].joyaxis = (auto_binds)[k].orig_joyaxis;
6251+
(general_binds)[k].joyaxis = (general_binds)[k].orig_joyaxis;
6252+
}
6253+
62386254
if (!all_users_control_menu)
62396255
break;
62406256
}

0 commit comments

Comments
 (0)