From 3cbe9fa5c27f58f84c365371ccf26d2018483cfd Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:34:12 -0400 Subject: [PATCH 01/19] Update xmb.c with "Kiosk Mode Fix" Added Kiosk Mode Fix --- menu/drivers/xmb.c | 123 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 106 insertions(+), 17 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 6376e05af2..5d2e2fd0b2 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -473,6 +473,10 @@ typedef struct xmb_handle /* Whether to show entry index for current list */ bool entry_idx_enabled; + + /* Kiosk Mode Fix - Makes sure we only call our function once after menu is ready */ + bool is_kiosk_init; + } xmb_handle_t; static float xmb_scale_mod[8] = { @@ -5855,6 +5859,12 @@ static enum menu_action xmb_parse_menu_entry_action( } else { + /* Kiosk Mode Fix - Only jump to Main Menu if not in Kiosk Mode!*/ + settings_t *settings = config_get_ptr(); + if(settings->bools.kiosk_mode_enable) + { + return MENU_ACTION_NOOP; + } /* Jump to Main Menu */ size_t i = 0; size_t current_tab = xmb->categories_selection_ptr; @@ -6507,11 +6517,14 @@ static bool xmb_context_reset_textures( } } } - - xmb->main_menu_node.icon = xmb->textures.list[XMB_TEXTURE_MAIN_MENU]; - xmb->main_menu_node.alpha = xmb->categories_active_alpha; - xmb->main_menu_node.zoom = xmb->categories_active_zoom; - + /* Kiosk Mode Fix - Hide Main Menu Icon if kiosk mode is enabled */ + settings_t *settings = config_get_ptr(); + if (!settings->bools.kiosk_mode_enable) + { + xmb->main_menu_node.icon = xmb->textures.list[XMB_TEXTURE_MAIN_MENU]; + xmb->main_menu_node.alpha = xmb->categories_active_alpha; + xmb->main_menu_node.zoom = xmb->categories_active_zoom; + } xmb->settings_tab_node.icon = xmb->textures.list[XMB_TEXTURE_SETTINGS]; xmb->settings_tab_node.alpha = xmb->categories_active_alpha; xmb->settings_tab_node.zoom = xmb->categories_active_zoom; @@ -8718,7 +8731,10 @@ static void *xmb_init(void **userdata, bool video_is_threaded) xmb->depth = 1; xmb->old_depth = 1; xmb->alpha = 1.0f; - + + /* Kiosk Mode Fix */ + xmb->is_kiosk_init = false; + xmb_refresh_system_tabs_list(xmb); for (i = 0; i < XMB_TAB_MAX_LENGTH; i++) @@ -8787,6 +8803,45 @@ error: return NULL; } +/* Kiosk Mode Fix */ +static void xmb_kiosk_mode_fix(xmb_handle_t *xmb) +{ + settings_t *settings = config_get_ptr(); + if (settings->bools.kiosk_mode_enable) + { + /* Only jump if we have a Horizontal Menu ( if Play lists Tab is not empty ! ) */ + /* If we have no playlists on the playlists tab, disable Kiosk mode and reset !*/ + if((unsigned)xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL) <= 0) + { + /* Disable Kiosk Mode ( Prevents Crash when kiosk mode enabled with no playlists ) */ + settings->bools.kiosk_mode_enable = false; + /* Re-Enable Main Menu Icon! */ + xmb->main_menu_node.icon = xmb->textures.list[XMB_TEXTURE_MAIN_MENU]; + xmb->main_menu_node.alpha = xmb->categories_active_alpha; + xmb->main_menu_node.zoom = xmb->categories_active_zoom; + /* Refresh list */ + xmb_refresh_system_tabs_list(xmb); + } + else + { + /* Jump one Categorie Right after init ( "hides" main menu ) */ + /* Only happens once on init */ + if (!xmb->is_kiosk_init) + { + struct menu_state *menu_st = menu_state_get_ptr(); + menu_list_t *menu_list = menu_st->entries.list; + + menu_entry_t entry; + MENU_ENTRY_INITIALIZE(entry); + menu_entry_get(&entry, 0, menu_st->selection_ptr, NULL, true); + + xmb_menu_entry_action(xmb, &entry, menu_st->selection_ptr, MENU_ACTION_RIGHT); + xmb->is_kiosk_init = true; + } + } + } +} + static void xmb_free(void *data) { xmb_handle_t *xmb = (xmb_handle_t*)data; @@ -9053,23 +9108,54 @@ static void xmb_list_cache(void *data, enum menu_list_type type, switch (action) { case MENU_ACTION_LEFT: - if (xmb->categories_selection_ptr == 0) + /* Kiosk Mode Fix - Only allow categorie movement between idx 1 and last instead of 0 ( skips main menu ) */ + if (settings->bools.kiosk_mode_enable) { - xmb->categories_selection_ptr = list_size; - xmb->categories_active_idx = (unsigned)(list_size - 1); + if (xmb->categories_selection_ptr == 1) + { + xmb->categories_selection_ptr = list_size; + xmb->categories_active_idx = (unsigned)(list_size - 1); + } + else + xmb->categories_selection_ptr--; + break; } else - xmb->categories_selection_ptr--; - break; + { + if (xmb->categories_selection_ptr == 0) + { + xmb->categories_selection_ptr = list_size; + xmb->categories_active_idx = (unsigned)(list_size - 1); + } + else + xmb->categories_selection_ptr--; + break; + } default: - if (xmb->categories_selection_ptr == list_size) + /* Kiosk Mode Fix - Only allow categorie movement between idx 1 and last instead of 0 ( skips main menu ) */ + if (settings->bools.kiosk_mode_enable) { - xmb->categories_selection_ptr = 0; - xmb->categories_active_idx = 1; + if (xmb->categories_selection_ptr == list_size) + { + xmb->categories_selection_ptr = 1; + xmb->categories_active_idx = 2; + } + else + xmb->categories_selection_ptr++; + break; } else - xmb->categories_selection_ptr++; - break; + { + if (xmb->categories_selection_ptr == list_size) + { + xmb->categories_selection_ptr = 0; + xmb->categories_active_idx = 1; + } + else + xmb->categories_selection_ptr++; + break; + } + } stack_size = menu_stack->size; @@ -9207,7 +9293,10 @@ static void xmb_toggle(void *userdata, bool menu_on) xmb_fade_out(xmb); return; } - + + /* Kiosk Mode Fix */ + xmb_kiosk_mode_fix(xmb); + /* Have to reset this, otherwise savestate * thumbnail won't update after selecting * 'save state' option */ From 274f253e75a296894122461531c786e12911188e Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:39:08 -0400 Subject: [PATCH 02/19] Update menu_displaylist.c with "Kiosk Mode Fix" added Kiosk Mode fixes --- menu/menu_displaylist.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index c89b86cc9c..0691596240 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -9578,8 +9578,8 @@ unsigned menu_displaylist_build_list( build_list[i].checked = settings->bools.settings_show_file_browser; break; case MENU_ENUM_LABEL_MENU_KIOSK_MODE_PASSWORD: - if (kiosk_mode_enable) - build_list[i].checked = true; + /* Kiosk Mode Fix - Always show Kiosk Password Settings Option */ + build_list[i].checked = true; break; case MENU_ENUM_LABEL_MENU_SCREENSAVER_TIMEOUT: if (menu_screensaver_supported) @@ -15407,6 +15407,20 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, #endif info->flags |= MD_FLAG_NEED_PUSH; + /* Kiosk Mode Fix - Add empty entry if list is empty */ + if(info->list->size <= 0 || settings->bools.kiosk_mode_enable) + { + menu_entries_clear(info->list); + menu_entries_append(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ITEMS), + msg_hash_to_str(MENU_ENUM_LABEL_NO_ITEMS), + MENU_ENUM_LABEL_NO_ITEMS, + MENU_SETTING_NO_ITEM, 0, 0, NULL); + + info->flags |= MD_FLAG_NEED_REFRESH + | MD_FLAG_NEED_PUSH; + break; + } } break; case DISPLAYLIST_HELP: From 01a3203a3a36ddf30e8af5454a5d2bd4f06ae88d Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:41:05 -0400 Subject: [PATCH 03/19] Update menu_setting.c with "Kiosk Mode Fix" added kiosk mode fixes --- menu/menu_setting.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 8758048ed1..666c2029d9 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -18591,7 +18591,8 @@ static bool setting_append_list( (*list)[list_info->index - 1].action_ok = setting_bool_action_left_with_refresh; (*list)[list_info->index - 1].action_left = setting_bool_action_left_with_refresh; (*list)[list_info->index - 1].action_right = setting_bool_action_right_with_refresh; - + MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_RESTART_RETROARCH);/* Kiosk Mode Fix - RESTART RETROARCH UPON SETTING KIOSK MODE!*/ + CONFIG_STRING( list, list_info, settings->paths.kiosk_mode_password, From 59442128a6264a1eef7b56c48ddb5473277845ba Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:44:18 -0400 Subject: [PATCH 04/19] Update runloop.c wth Kiosk Mode Hotkey added hotkey check cmd --- runloop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runloop.c b/runloop.c index 19bb1b73f7..eb7fe13d46 100644 --- a/runloop.c +++ b/runloop.c @@ -6118,6 +6118,9 @@ static enum runloop_state_enum runloop_check_state( /* Check close content hotkey */ HOTKEY_CHECK(RARCH_CLOSE_CONTENT_KEY, CMD_EVENT_CLOSE_CONTENT, true, NULL); + /* Check Kiosk hotkey */ + HOTKEY_CHECK(RARCH_KIOSK_MODE, CMD_EVENT_KIOSK, true, NULL); + /* Check FPS hotkey */ HOTKEY_CHECK(RARCH_FPS_TOGGLE, CMD_EVENT_FPS_TOGGLE, true, NULL); From b63e982712a2e277f36b783c9f4904384fcad9fb Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:45:58 -0400 Subject: [PATCH 05/19] Update all_binds_empty.cfg with Kiosk Toggle added kiosk toggle input hotkey test, f5 is used by companion so might have to use different hotkey --- tests-other/all_binds_empty.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/tests-other/all_binds_empty.cfg b/tests-other/all_binds_empty.cfg index 51fe9f76d1..ef5a090872 100644 --- a/tests-other/all_binds_empty.cfg +++ b/tests-other/all_binds_empty.cfg @@ -6,6 +6,7 @@ input_exit_emulator = "escape" input_max_users = "10" input_fps_toggle = "f3" +input_kiosk_toggle = "f5" input_ai_service = "nul" input_ai_service_axis = "nul" From 5531f743eaddeb9921937fab7e6791c3706e5b04 Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:48:01 -0400 Subject: [PATCH 06/19] Update rarch.rc with kiosk mode --- media/rarch.rc | 1 + 1 file changed, 1 insertion(+) diff --git a/media/rarch.rc b/media/rarch.rc index 02867a4382..0583243ee5 100644 --- a/media/rarch.rc +++ b/media/rarch.rc @@ -47,6 +47,7 @@ IDR_MENU MENU MENUITEM "Load State", ID_M_LOAD_STATE MENUITEM "Save State", ID_M_SAVE_STATE } + MENUITEM "Kiosk", ID_M_KIOSK MENUITEM "Reset", ID_M_RESET MENUITEM "Pause Toggle", ID_M_PAUSE_TOGGLE MENUITEM "Menu Toggle", ID_M_MENU_TOGGLE From 9bc3d5e65691c3c12ae00b6cd26f6199aac7d5aa Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:49:28 -0400 Subject: [PATCH 07/19] Update ui_win32_resource.h with kiosk mode there needs to be an empty line as the last line! added kiosk mode --- ui/drivers/ui_win32_resource.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/drivers/ui_win32_resource.h b/ui/drivers/ui_win32_resource.h index 1baed7a134..5aa2f21c86 100644 --- a/ui/drivers/ui_win32_resource.h +++ b/ui/drivers/ui_win32_resource.h @@ -40,3 +40,4 @@ #define ID_M_TAKE_SCREENSHOT 40035 #define ID_M_MUTE_TOGGLE 40036 #define ID_M_TOGGLE_DESKTOP 40037 +#define ID_M_KIOSK 40038 From 19df62e737f8b6d339ff26eafa847380c6d14508 Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:51:31 -0400 Subject: [PATCH 08/19] Update win32_common.c with kiosk mode added kiosk mode --- gfx/common/win32_common.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index 0d44ba14a5..097cd625f5 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -802,6 +802,8 @@ static LRESULT win32_menu_loop(HWND owner, WPARAM wparam) win32_load_content_from_gui(win32_file); } break; + case ID_M_KIOSK: + command_event(CMD_EVENT_KIOSK, NULL); case ID_M_RESET: command_event(CMD_EVENT_RESET, NULL); break; @@ -2028,6 +2030,8 @@ static enum msg_hash_enums menu_id_to_label_enum(unsigned int menuId) { case ID_M_LOAD_CONTENT: return MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST; + case ID_M_KIOSK: + return MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK; case ID_M_RESET: return MENU_ENUM_LABEL_VALUE_RESTART_CONTENT; case ID_M_QUIT: @@ -2068,6 +2072,8 @@ static unsigned int menu_id_to_meta_key(unsigned int menu_id) { switch (menu_id) { + case ID_M_KIOSK: + return RARCH_KIOSK_MODE; case ID_M_RESET: return RARCH_RESET; case ID_M_QUIT: From 2d16bbd5a2d7ca37006babfa1ba7a286d9a0405b Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:53:49 -0400 Subject: [PATCH 09/19] Update config.def.keybinds.h with Kiosk Mode I used f5 as the hotkey, this conflicts with companion UI hotkey, so def needs changing.. --- config.def.keybinds.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/config.def.keybinds.h b/config.def.keybinds.h index e6190e0db8..8230e72f26 100644 --- a/config.def.keybinds.h +++ b/config.def.keybinds.h @@ -570,6 +570,13 @@ static const struct retro_keybind retro_keybinds_1[] = { RARCH_UI_COMPANION_TOGGLE, NO_BTN, NO_BTN, 0, true }, + { + NULL, NULL, + AXIS_NONE, AXIS_NONE, + MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK, RETROK_UNKNOWN, + RARCH_KIOSK_MODE, NO_BTN, NO_BTN, 0, + true + }, { NULL, NULL, AXIS_NONE, AXIS_NONE, @@ -1209,6 +1216,13 @@ static const struct retro_keybind retro_keybinds_1[] = { RARCH_UI_COMPANION_TOGGLE, NO_BTN, NO_BTN, 0, true }, + { + NULL, NULL, + AXIS_NONE, AXIS_NONE, + MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK, RETROK_UNKNOWN, + RARCH_KIOSK_MODE, NO_BTN, NO_BTN, 0, + true + }, { NULL, NULL, AXIS_NONE, AXIS_NONE, @@ -1858,6 +1872,13 @@ static const struct retro_keybind retro_keybinds_1[] = { RARCH_UI_COMPANION_TOGGLE, NO_BTN, NO_BTN, 0, true }, + { + NULL, NULL, + AXIS_NONE, AXIS_NONE, + MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK, RETROK_F5, + RARCH_KIOSK_MODE, NO_BTN, NO_BTN, 0, + true + }, { NULL, NULL, AXIS_NONE, AXIS_NONE, From 390f1d3760986f2c8f1947f0d61a27923c3aae9c Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:54:40 -0400 Subject: [PATCH 10/19] Update input_defines.h with kiosk mode --- input/input_defines.h | 1 + 1 file changed, 1 insertion(+) diff --git a/input/input_defines.h b/input/input_defines.h index ea18b5e11a..95ddfbce70 100644 --- a/input/input_defines.h +++ b/input/input_defines.h @@ -126,6 +126,7 @@ enum RARCH_MENU_TOGGLE, RARCH_QUIT_KEY, RARCH_CLOSE_CONTENT_KEY, + RARCH_KIOSK_MODE, RARCH_RESET, RARCH_FAST_FORWARD_KEY, RARCH_FAST_FORWARD_HOLD_KEY, From d236ecfa282cfb99a71e0790c3d94ecfabd4e4dc Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:56:33 -0400 Subject: [PATCH 11/19] Update msg_hash.h with kiosk mode added input_meta_kiosk --- msg_hash.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/msg_hash.h b/msg_hash.h index 95b4b85a7a..8025fe4cd5 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1102,6 +1102,7 @@ enum msg_hash_enums MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY, + MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK, MENU_ENUM_LABEL_VALUE_INPUT_META_RESTART_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_CLOSE_CONTENT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET, @@ -1201,6 +1202,7 @@ enum msg_hash_enums MENU_ENUM_SUBLABEL_INPUT_META_ENABLE_HOTKEY, MENU_ENUM_SUBLABEL_INPUT_META_MENU_TOGGLE, MENU_ENUM_SUBLABEL_INPUT_META_QUIT_KEY, + MENU_ENUM_SUBLABEL_INPUT_META_KIOSK, MENU_ENUM_SUBLABEL_INPUT_META_RESTART_KEY, MENU_ENUM_SUBLABEL_INPUT_META_CLOSE_CONTENT_KEY, MENU_ENUM_SUBLABEL_INPUT_META_RESET, From a6aa14208bd5742410fa23379ec3dd522bf0f9ae Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:58:42 -0400 Subject: [PATCH 12/19] Update msg_hash_us.h with kiosk mode added meta_kiosk --- intl/msg_hash_us.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 49449d9f65..9068ebe0a5 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -16111,6 +16111,14 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_PAL60_ENABLE, "Use PAL60 Mode" ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK, + "Kiosk Mode (Toggle)" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_INPUT_META_KIOSK, + "Toggles Kiosk Mode." + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_INPUT_META_RESTART_KEY, "Restart RetroArch" From 6cae1c91cb9ffbfe8d4302d9b99e947310e8bf51 Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 06:59:52 -0400 Subject: [PATCH 13/19] Update configuration.c with kiosk mode added the kiosk_toggle bind --- configuration.c | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.c b/configuration.c index 7ab370d092..cd7d8b52d3 100644 --- a/configuration.c +++ b/configuration.c @@ -344,6 +344,7 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = { DECLARE_META_BIND(2, exit_emulator, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY), #endif DECLARE_META_BIND(2, close_content, RARCH_CLOSE_CONTENT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_CLOSE_CONTENT_KEY), + DECLARE_META_BIND(2, kiosk_toggle, RARCH_KIOSK_MODE, MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK), DECLARE_META_BIND(2, reset, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET), DECLARE_META_BIND(1, toggle_fast_forward, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY), DECLARE_META_BIND(2, hold_fast_forward, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY), From 824182a54aafb76e213714f6b3301fb56561557c Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 07:01:19 -0400 Subject: [PATCH 14/19] Update command.h with kiosk mode added kiosk mode --- command.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/command.h b/command.h index 154b35b083..ceae119934 100644 --- a/command.h +++ b/command.h @@ -43,6 +43,8 @@ enum event_command { CMD_SPECIAL = -1, CMD_EVENT_NONE = 0, + /* Toggle Kiosk Mode*/ + CMD_EVENT_KIOSK, /* Resets RetroArch. */ CMD_EVENT_RESET, CMD_EVENT_SET_PER_GAME_RESOLUTION, @@ -456,6 +458,7 @@ static const struct cmd_map map[] = { { "MENU_TOGGLE", RARCH_MENU_TOGGLE }, { "QUIT", RARCH_QUIT_KEY }, { "CLOSE_CONTENT", RARCH_CLOSE_CONTENT_KEY }, + { "KIOSK_MODE", RARCH_KIOSK_MODE }, { "RESET", RARCH_RESET }, { "FAST_FORWARD", RARCH_FAST_FORWARD_KEY }, From 76b515cd3850556d5fc8ea7c0aa566a2e4dfe3c5 Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 07:07:02 -0400 Subject: [PATCH 15/19] Update retroarch.c wiht Kiosk Mode Added kiosk hotkey case and function --- retroarch.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/retroarch.c b/retroarch.c index 8ce2ed2f21..c160371fbc 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2985,6 +2985,38 @@ bool is_accessibility_enabled(bool accessibility_enable, bool accessibility_enab } #endif + +/* Kiosk Mode Fix - Confirm User Input - slighlty modified menu_input_st_string_cb_disable_kiosk_mode function from menu_cbs_ok.c */ +static void kiosk_password_input_complete(void *userdata, const char *line) +{ + if (line && *line) + { + const char *label = menu_input_dialog_get_buffer(); + settings_t *settings = config_get_ptr(); + const char *path_kiosk_mode_password = + settings->paths.kiosk_mode_password; + + if (string_is_equal(label, path_kiosk_mode_password)) + { + const char *_msg = msg_hash_to_str(MSG_INPUT_KIOSK_MODE_PASSWORD_OK); + runloop_msg_queue_push(_msg, strlen(_msg), 1, 100, true, NULL, + MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); + /* Disable Kiosk Mode and Restart RetroArch! */ + settings->bools.kiosk_mode_enable = false; + command_event(CMD_EVENT_RESTART_RETROARCH, NULL); + } + else + { + const char *_msg = msg_hash_to_str(MSG_INPUT_KIOSK_MODE_PASSWORD_NOK); + runloop_msg_queue_push(_msg, strlen(_msg), 1, 100, true, NULL, + MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); + } + } + + menu_input_dialog_end(); +} + + /** * command_event: * @cmd : Event command index. @@ -3430,6 +3462,24 @@ bool command_event(enum event_command cmd, void *data) retroarch_menu_running(); #endif break; + /* Kiosk Mode Fix */ + case CMD_EVENT_KIOSK: + /* If were already in Kiosk Mode, ask for the Password! */ + if (settings->bools.kiosk_mode_enable && settings->paths.kiosk_mode_password != "") + { + menu_input_ctx_line_t line; + line.label = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MENU_KIOSK_MODE_PASSWORD); + line.label_setting = NULL; + line.type = 0; + line.idx = 0; + line.cb = kiosk_password_input_complete; + menu_input_dialog_start(&line); + break; + } + /* Toggle Kiosk mode then Restart Retroarch */ + settings->bools.kiosk_mode_enable = !(settings->bools.kiosk_mode_enable); + command_event(CMD_EVENT_RESTART_RETROARCH, NULL); + break; case CMD_EVENT_RESET: { const char *_msg = msg_hash_to_str(MSG_RESET); From 1ca2e085909a120cc84fe52f77a63d15b5fa3b9b Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 08:24:27 -0400 Subject: [PATCH 16/19] Update xmb.c with kiosk mode fix Forgot to add the settings_t *settings = config_get_ptr(); ptr in xmb list cache --- menu/drivers/xmb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 5d2e2fd0b2..0c1c61bcfd 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -9059,6 +9059,7 @@ static void xmb_list_cache(void *data, enum menu_list_type type, file_list_t *menu_stack = MENU_LIST_GET(menu_list, 0); file_list_t *selection_buf = MENU_LIST_GET_SELECTION(menu_list, 0); size_t selection = menu_st->selection_ptr; + settings_t *settings = config_get_ptr(); unsigned horizontal_list_size = (xmb->show_playlist_tabs) ? (unsigned)xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL) : 0; From 3315e96b2dac14e9742e5e5a0c6e6a59b0292786 Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 08:41:03 -0400 Subject: [PATCH 17/19] Update xmb.c with kiosk mode Fixed Linux bug for mixing declaration with code, oops. --- menu/drivers/xmb.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 0c1c61bcfd..01125849e6 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -5859,16 +5859,17 @@ static enum menu_action xmb_parse_menu_entry_action( } else { - /* Kiosk Mode Fix - Only jump to Main Menu if not in Kiosk Mode!*/ + /* Jump to Main Menu */ settings_t *settings = config_get_ptr(); + size_t i = 0; + size_t current_tab = xmb->categories_selection_ptr; + + /* Kiosk Mode Fix - Only jump to Main Menu if not in Kiosk Mode!*/ if(settings->bools.kiosk_mode_enable) { return MENU_ACTION_NOOP; } - /* Jump to Main Menu */ - size_t i = 0; - size_t current_tab = xmb->categories_selection_ptr; - + menu_entry_t entry; MENU_ENTRY_INITIALIZE(entry); menu_entry_get(&entry, 0, menu_st->selection_ptr, NULL, true); From 67b5da6a506ca3f59b4bd581fb5b29bf8f3fa058 Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 08:46:48 -0400 Subject: [PATCH 18/19] Update retroarch.c with kiosk mode fix Changed string check to function string_is_empty for PS4 compliance! --- retroarch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroarch.c b/retroarch.c index c160371fbc..04107108fe 100644 --- a/retroarch.c +++ b/retroarch.c @@ -3465,7 +3465,7 @@ bool command_event(enum event_command cmd, void *data) /* Kiosk Mode Fix */ case CMD_EVENT_KIOSK: /* If were already in Kiosk Mode, ask for the Password! */ - if (settings->bools.kiosk_mode_enable && settings->paths.kiosk_mode_password != "") + if (settings->bools.kiosk_mode_enable && !string_is_empty(settings->paths.kiosk_mode_password)) { menu_input_ctx_line_t line; line.label = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MENU_KIOSK_MODE_PASSWORD); From 49d4a580d94c841353d635dced2a6fa214b884c0 Mon Sep 17 00:00:00 2001 From: Lhaete <57153084+Lhaete@users.noreply.github.com> Date: Fri, 6 Jun 2025 08:56:37 -0400 Subject: [PATCH 19/19] Update xmb.c with kiosk mode Linux Fix for mixing declaration and code, missed them the first time oops again! --- menu/drivers/xmb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 01125849e6..790442336a 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -5863,14 +5863,14 @@ static enum menu_action xmb_parse_menu_entry_action( settings_t *settings = config_get_ptr(); size_t i = 0; size_t current_tab = xmb->categories_selection_ptr; + menu_entry_t entry; /* Kiosk Mode Fix - Only jump to Main Menu if not in Kiosk Mode!*/ if(settings->bools.kiosk_mode_enable) { return MENU_ACTION_NOOP; } - - menu_entry_t entry; + MENU_ENTRY_INITIALIZE(entry); menu_entry_get(&entry, 0, menu_st->selection_ptr, NULL, true); @@ -6448,6 +6448,7 @@ static bool xmb_context_reset_textures( const char *iconpath, unsigned menu_xmb_theme) { + settings_t *settings = config_get_ptr(); unsigned i; for (i = 0; i < XMB_TEXTURE_LAST; i++) @@ -6519,7 +6520,6 @@ static bool xmb_context_reset_textures( } } /* Kiosk Mode Fix - Hide Main Menu Icon if kiosk mode is enabled */ - settings_t *settings = config_get_ptr(); if (!settings->bools.kiosk_mode_enable) { xmb->main_menu_node.icon = xmb->textures.list[XMB_TEXTURE_MAIN_MENU];