diff --git a/menu/menu_entries_cbs.c b/menu/menu_entries_cbs.c index ef723fdab0..0f8e1e479e 100644 --- a/menu/menu_entries_cbs.c +++ b/menu/menu_entries_cbs.c @@ -142,6 +142,7 @@ int menu_entries_common_is_settings_entry(const char *label) !strcmp(label, "Font Settings") || !strcmp(label, "Audio Settings") || !strcmp(label, "Input Settings") || + !strcmp(label, "Input Hotkey Settings") || !strcmp(label, "Overlay Settings") || !strcmp(label, "Onscreen Keyboard Overlay Settings") || !strcmp(label, "Menu Settings") || diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 47836a73c2..fd3073cdf8 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5052,6 +5052,38 @@ static bool setting_append_list_audio_options( return true; } +static bool setting_append_list_input_hotkey_options( + rarch_setting_t **list, + rarch_setting_info_t *list_info) +{ + rarch_setting_group_info_t group_info; + rarch_setting_group_info_t subgroup_info; + unsigned i; + settings_t *settings = config_get_ptr(); + + START_GROUP(group_info, "Input Hotkey Settings"); + START_SUB_GROUP(list, list_info, "State", group_info.name, subgroup_info); + + for (i = 0; i < RARCH_BIND_LIST_END; i ++) + { + const struct input_bind_map* keybind = (const struct input_bind_map*) + &input_config_bind_map[i]; + + if (!keybind || !keybind->meta) + continue; + + CONFIG_BIND(settings->input.binds[0][i], 0, 0, + keybind->base, keybind->desc, &retro_keybinds_1[i], + group_info.name, subgroup_info.name); + menu_settings_list_current_add_bind_type(list, list_info, i + MENU_SETTINGS_BIND_BEGIN); + } + + END_SUB_GROUP(list, list_info); + END_GROUP(list, list_info); + + return true; +} + static bool setting_append_list_input_options( rarch_setting_t **list, rarch_setting_info_t *list_info) @@ -5305,30 +5337,6 @@ static bool setting_append_list_input_options( END_SUB_GROUP(list, list_info); - /* The second argument to config bind is 1 - * based for users and 0 only for meta keys. */ - START_SUB_GROUP( - list, - list_info, - "Meta Keys", - group_info.name, - subgroup_info); - - for (i = 0; i < RARCH_BIND_LIST_END; i ++) - { - const struct input_bind_map* keybind = (const struct input_bind_map*) - &input_config_bind_map[i]; - - if (!keybind || !keybind->meta) - continue; - - CONFIG_BIND(settings->input.binds[0][i], 0, 0, - keybind->base, keybind->desc, &retro_keybinds_1[i], - group_info.name, subgroup_info.name); - menu_settings_list_current_add_bind_type(list, list_info, i + MENU_SETTINGS_BIND_BEGIN); - } - END_SUB_GROUP(list, list_info); - for (user = 0; user < settings->input.max_users; user++) { /* This constants matches the string length. @@ -6796,6 +6804,12 @@ rarch_setting_t *menu_setting_new(unsigned mask) if (!setting_append_list_input_options(&list, list_info)) goto error; } + + if (mask & SL_FLAG_INPUT_HOTKEY_OPTIONS) + { + if (!setting_append_list_input_hotkey_options(&list, list_info)) + goto error; + } if (mask & SL_FLAG_OVERLAY_OPTIONS) { diff --git a/menu/menu_setting.h b/menu/menu_setting.h index ac77c94e35..9be753c669 100644 --- a/menu/menu_setting.h +++ b/menu/menu_setting.h @@ -80,23 +80,24 @@ enum setting_list_flags SL_FLAG_FONT_OPTIONS = (1 << 7), SL_FLAG_AUDIO_OPTIONS = (1 << 8), SL_FLAG_INPUT_OPTIONS = (1 << 9), - SL_FLAG_OVERLAY_OPTIONS = (1 << 10), - SL_FLAG_OSK_OVERLAY_OPTIONS = (1 << 11), - SL_FLAG_MENU_OPTIONS = (1 << 12), - SL_FLAG_UI_OPTIONS = (1 << 13), - SL_FLAG_CORE_UPDATER_OPTIONS = (1 << 14), - SL_FLAG_NETPLAY_OPTIONS = (1 << 15), - SL_FLAG_USER_OPTIONS = (1 << 16), - SL_FLAG_DIRECTORY_OPTIONS = (1 << 17), - SL_FLAG_PRIVACY_OPTIONS = (1 << 18), - SL_FLAG_PLAYLIST_OPTIONS = (1 << 19), - SL_FLAG_ARCHIVE_OPTIONS = (1 << 20), - SL_FLAG_PATCH_OPTIONS = (1 << 21), - SL_FLAG_RECORDING_OPTIONS = (1 << 21), - SL_FLAG_FRAME_THROTTLE_OPTIONS= (1 << 22), - SL_FLAG_LOGGING_OPTIONS = (1 << 23), - SL_FLAG_SAVING_OPTIONS = (1 << 24), - SL_FLAG_ALL = (1 << 25), + SL_FLAG_INPUT_HOTKEY_OPTIONS = (1 << 10), + SL_FLAG_OVERLAY_OPTIONS = (1 << 11), + SL_FLAG_OSK_OVERLAY_OPTIONS = (1 << 12), + SL_FLAG_MENU_OPTIONS = (1 << 13), + SL_FLAG_UI_OPTIONS = (1 << 14), + SL_FLAG_CORE_UPDATER_OPTIONS = (1 << 15), + SL_FLAG_NETPLAY_OPTIONS = (1 << 16), + SL_FLAG_USER_OPTIONS = (1 << 17), + SL_FLAG_DIRECTORY_OPTIONS = (1 << 18), + SL_FLAG_PRIVACY_OPTIONS = (1 << 19), + SL_FLAG_PLAYLIST_OPTIONS = (1 << 20), + SL_FLAG_ARCHIVE_OPTIONS = (1 << 21), + SL_FLAG_PATCH_OPTIONS = (1 << 22), + SL_FLAG_RECORDING_OPTIONS = (1 << 23), + SL_FLAG_FRAME_THROTTLE_OPTIONS= (1 << 24), + SL_FLAG_LOGGING_OPTIONS = (1 << 25), + SL_FLAG_SAVING_OPTIONS = (1 << 26), + SL_FLAG_ALL = (1 << 27), }; #define SL_FLAG_ALL_SETTINGS (SL_FLAG_ALL - SL_FLAG_MAIN_MENU)