diff --git a/configuration.c b/configuration.c index e0a7111958..e807e27b72 100644 --- a/configuration.c +++ b/configuration.c @@ -5164,13 +5164,7 @@ bool input_remapping_load_file(void *data, const char *path) key_ident[0] = '\0'; fill_pathname_join_delim(stk_ident, s3, - key_string, '$', sizeof(stk_ident)); - - snprintf(stk_ident, - sizeof(stk_ident), - "%s_%s", - s3, - key_string); + key_string, '_', sizeof(stk_ident)); if (config_get_int(conf, stk_ident, &stk_remap)) { diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 0b3f9d9be3..7cdbbc9679 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -2824,8 +2824,10 @@ MSG_HASH( MENU_ENUM_LABEL_REMAP_FILE_REMOVE_GAME, "remap_file_remove_game" ) - - +MSG_HASH( + MENU_ENUM_LABEL_REMAP_FILE_RESET, + "remap_file_reset" + ) MSG_HASH( MENU_ENUM_LABEL_RESTART_CONTENT, "restart_content" diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 58833fea0a..a6fc56b9ae 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -7094,6 +7094,14 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_REMAP_FILE_REMOVE_GAME, "Delete Game Remap File" ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_REMAP_FILE_RESET, + "Reset Input Mapping" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_REMAP_FILE_RESET, + "Set all input remapping options to default values." + ) /* Quick Menu > Controls > Manage Remap Files > Load Remap File */ @@ -12107,6 +12115,10 @@ MSG_HASH( MSG_REMAP_FILE_REMOVED_SUCCESSFULLY, "Remap file removed successfully." ) +MSG_HASH( + MSG_REMAP_FILE_RESET, + "All input remapping options reset to default." + ) MSG_HASH( MSG_REMOVED_DISK_FROM_TRAY, "Removed disk from tray." diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 9bb0a99a4b..ef53eed4c0 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -3601,6 +3601,17 @@ static int action_ok_remap_file_remove_game(const char *path, idx, entry_idx, ACTION_OK_REMAP_FILE_REMOVE_GAME); } +static int action_ok_remap_file_reset(const char *path, + const char *label, unsigned type, size_t idx, size_t entry_idx) +{ + input_remapping_set_defaults(false); + runloop_msg_queue_push( + msg_hash_to_str(MSG_REMAP_FILE_RESET), + 1, 100, true, + NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); + return 0; +} + int action_ok_path_use_directory(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { @@ -8194,6 +8205,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs, {MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CORE, action_ok_remap_file_remove_core}, {MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CONTENT_DIR, action_ok_remap_file_remove_content_dir}, {MENU_ENUM_LABEL_REMAP_FILE_REMOVE_GAME, action_ok_remap_file_remove_game}, + {MENU_ENUM_LABEL_REMAP_FILE_RESET, action_ok_remap_file_reset}, {MENU_ENUM_LABEL_PLAYLISTS_TAB, action_ok_content_collection_list}, {MENU_ENUM_LABEL_BROWSE_URL_LIST, action_ok_browse_url_list}, {MENU_ENUM_LABEL_CORE_LIST, action_ok_core_list}, diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 97b074fb57..9c7eb11533 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -834,6 +834,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_save_current_config_override_game, DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_shader_options, MENU_ENUM_SUBLABEL_SHADER_OPTIONS) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_core_input_remapping_options, MENU_ENUM_SUBLABEL_CORE_INPUT_REMAPPING_OPTIONS) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_remap_file_manager_list, MENU_ENUM_SUBLABEL_REMAP_FILE_MANAGER_LIST) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_remap_file_reset, MENU_ENUM_SUBLABEL_REMAP_FILE_RESET) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_core_option_override_list, MENU_ENUM_SUBLABEL_CORE_OPTION_OVERRIDE_LIST) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_core_options_reset, MENU_ENUM_SUBLABEL_CORE_OPTIONS_RESET) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_core_options_flush, MENU_ENUM_SUBLABEL_CORE_OPTIONS_FLUSH) @@ -2897,6 +2898,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_REMAP_FILE_MANAGER_LIST: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_remap_file_manager_list); break; + case MENU_ENUM_LABEL_REMAP_FILE_RESET: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_remap_file_reset); + break; case MENU_ENUM_LABEL_CORE_CHEAT_OPTIONS: #ifdef HAVE_CHEATS BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_core_cheat_options); diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index b93f80c45e..af29087934 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -10208,6 +10208,7 @@ static void materialui_list_insert( node->icon_type = MUI_ICON_TYPE_INTERNAL; break; case MENU_SETTING_ACTION_CORE_OPTIONS_RESET: + case MENU_SETTING_ACTION_REMAP_FILE_RESET: node->icon_texture_index = MUI_TEXTURE_UNDO_SAVE_STATE; node->icon_type = MUI_ICON_TYPE_INTERNAL; break; diff --git a/menu/drivers/ozone.c b/menu/drivers/ozone.c index 37965c11b2..00b1f3674f 100644 --- a/menu/drivers/ozone.c +++ b/menu/drivers/ozone.c @@ -1832,6 +1832,7 @@ static uintptr_t ozone_entries_icon_get_texture(ozone_handle_t *ozone, case MENU_ENUM_LABEL_REMAP_FILE_REMOVE_GAME: return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_CLOSE]; case MENU_ENUM_LABEL_CORE_OPTIONS_RESET: + case MENU_ENUM_LABEL_REMAP_FILE_RESET: return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_UNDO]; case MENU_ENUM_LABEL_CORE_OPTIONS_FLUSH: return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_FILE]; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 6a08df4857..f7f7c7837b 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -2805,6 +2805,7 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb, case MENU_ENUM_LABEL_REMAP_FILE_REMOVE_GAME: return xmb->textures.list[XMB_TEXTURE_CLOSE]; case MENU_ENUM_LABEL_CORE_OPTIONS_RESET: + case MENU_ENUM_LABEL_REMAP_FILE_RESET: return xmb->textures.list[XMB_TEXTURE_UNDO]; case MENU_ENUM_LABEL_CORE_OPTIONS_FLUSH: return xmb->textures.list[XMB_TEXTURE_FILE]; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index ae394c120b..5cec06d568 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -1381,6 +1381,14 @@ static unsigned menu_displaylist_parse_remap_file_manager_list( MENU_ENUM_LABEL_REMAP_FILE_REMOVE_CORE, MENU_SETTING_ACTION_REMAP_FILE_REMOVE_CORE, 0, 0)) count++; + + /* Reset input remaps */ + if (menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_REMAP_FILE_RESET), + msg_hash_to_str(MENU_ENUM_LABEL_REMAP_FILE_RESET), + MENU_ENUM_LABEL_REMAP_FILE_RESET, + MENU_SETTING_ACTION_REMAP_FILE_RESET, 0, 0)) + count++; end: /* Fallback */ if (count == 0) diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 5666c61bed..a2c87a509c 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -283,6 +283,7 @@ enum menu_settings_type MENU_SETTING_ACTION_REMAP_FILE_REMOVE_CORE, MENU_SETTING_ACTION_REMAP_FILE_REMOVE_CONTENT_DIR, MENU_SETTING_ACTION_REMAP_FILE_REMOVE_GAME, + MENU_SETTING_ACTION_REMAP_FILE_RESET, MENU_SETTING_ACTION_CONTENTLESS_CORE_RUN, diff --git a/msg_hash.h b/msg_hash.h index 32e7d32896..2be8d7a5a6 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -356,6 +356,7 @@ enum msg_hash_enums MSG_INPUT_KIOSK_MODE_PASSWORD_NOK, MSG_REMAP_FILE_SAVED_SUCCESSFULLY, MSG_REMAP_FILE_REMOVED_SUCCESSFULLY, + MSG_REMAP_FILE_RESET, MSG_SHADER_PRESET_SAVED_SUCCESSFULLY, MSG_SHADER_PRESET_REMOVED_SUCCESSFULLY, MSG_ERROR_SAVING_REMAP_FILE, @@ -2598,6 +2599,7 @@ enum msg_hash_enums MENU_LABEL(REMAP_FILE_REMOVE_CORE), MENU_LABEL(REMAP_FILE_REMOVE_CONTENT_DIR), MENU_LABEL(REMAP_FILE_REMOVE_GAME), + MENU_LABEL(REMAP_FILE_RESET), MENU_LABEL(RESTART_CONTENT), MENU_LABEL(RESUME),