mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 16:13:40 +00:00
Create menu_driver_toggle_binds
This commit is contained in:
parent
00ff63e0bb
commit
7b460c14b7
@ -206,6 +206,24 @@ static void menu_input_key_event(bool down, unsigned keycode,
|
||||
menu_entry_action(NULL, 0, MENU_ACTION_SEARCH);
|
||||
}
|
||||
|
||||
void menu_driver_toggle_binds(bool latch)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (!settings)
|
||||
return;
|
||||
|
||||
if (latch)
|
||||
{
|
||||
memcpy(settings->input.binds[0], retro_keybinds_menu,
|
||||
sizeof(retro_keybinds_1));
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(settings->input.binds[0], retro_keybinds_1,
|
||||
sizeof(retro_keybinds_1));
|
||||
}
|
||||
}
|
||||
|
||||
static void menu_driver_toggle(bool latch)
|
||||
{
|
||||
retro_keyboard_event_t *key_event = NULL;
|
||||
@ -245,10 +263,8 @@ static void menu_driver_toggle(bool latch)
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_SET_FRAME_TIME_LAST, NULL);
|
||||
}
|
||||
|
||||
if (settings)
|
||||
memcpy(settings->input.binds[0], retro_keybinds_menu,
|
||||
sizeof(retro_keybinds_1));
|
||||
|
||||
menu_driver_toggle_binds(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -265,9 +281,7 @@ static void menu_driver_toggle(bool latch)
|
||||
if (key_event && frontend_key_event)
|
||||
*key_event = *frontend_key_event;
|
||||
|
||||
if (settings)
|
||||
memcpy(settings->input.binds[0], retro_keybinds_1,
|
||||
sizeof(retro_keybinds_1));
|
||||
menu_driver_toggle_binds(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -421,6 +421,8 @@ extern unsigned int rdb_entry_start_game_selection_ptr;
|
||||
|
||||
bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data);
|
||||
|
||||
void menu_driver_toggle_binds(bool latch);
|
||||
|
||||
extern menu_ctx_driver_t menu_ctx_xui;
|
||||
extern menu_ctx_driver_t menu_ctx_rgui;
|
||||
extern menu_ctx_driver_t menu_ctx_mui;
|
||||
|
Loading…
x
Reference in New Issue
Block a user