Skip to content

Commit e1ad2ca

Browse files
Add 'Ignore Enable Hotkey for Menu Toggle' option
Adds a new boolean setting that allows Menu Toggle to bypass the Enable Hotkey modifier. Handheld users with a dedicated menu button can enable this so Menu Toggle works without holding Enable Hotkey, while all other hotkeys still respect it. May fix #18396
1 parent 8b53192 commit e1ad2ca

10 files changed

Lines changed: 48 additions & 2 deletions

File tree

config.def.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,7 @@
16611661
#define DEFAULT_INPUT_HOTKEY_BLOCK_DELAY 5
16621662
#define DEFAULT_INPUT_HOTKEY_DEVICE_MERGE false
16631663
#define DEFAULT_INPUT_HOTKEY_FOLLOWS_PLAYER1 false
1664+
#define DEFAULT_INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY false
16641665

16651666
#define DEFAULT_GFX_THUMBNAILS_DEFAULT 3
16661667

configuration.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,6 +2187,7 @@ static struct config_bool_setting *populate_settings_bool(
21872187
SETTING_BOOL("input_remap_sort_by_controller_enable", &settings->bools.input_remap_sort_by_controller_enable, true, false, false);
21882188
SETTING_BOOL("input_hotkey_device_merge", &settings->bools.input_hotkey_device_merge, true, DEFAULT_INPUT_HOTKEY_DEVICE_MERGE, false);
21892189
SETTING_BOOL("input_hotkey_follows_player1", &settings->bools.input_hotkey_follows_player1, true, DEFAULT_INPUT_HOTKEY_FOLLOWS_PLAYER1, false);
2190+
SETTING_BOOL("input_menu_toggle_ignore_enable_hotkey", &settings->bools.input_menu_toggle_ignore_enable_hotkey, true, DEFAULT_INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY, false);
21902191
#ifdef HAVE_MENU
21912192
SETTING_BOOL("all_users_control_menu", &settings->bools.input_all_users_control_menu, true, DEFAULT_ALL_USERS_CONTROL_MENU, false);
21922193
SETTING_BOOL("menu_swap_ok_cancel_buttons", &settings->bools.input_menu_swap_ok_cancel_buttons, true, DEFAULT_MENU_SWAP_OK_CANCEL_BUTTONS, false);

configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ typedef struct settings
763763
bool input_turbo_allow_dpad;
764764
bool input_hotkey_device_merge;
765765
bool input_hotkey_follows_player1;
766+
bool input_menu_toggle_ignore_enable_hotkey;
766767
#if defined(HAVE_DINPUT) || defined(HAVE_WINRAWINPUT)
767768
bool input_nowinkey_enable;
768769
#endif

input/input_driver.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5923,7 +5923,8 @@ static void input_keys_pressed(
59235923
const input_device_driver_t *joypad,
59245924
const input_device_driver_t *sec_joypad,
59255925
rarch_joypad_info_t *joypad_info,
5926-
bool input_hotkey_device_merge)
5926+
bool input_hotkey_device_merge,
5927+
bool input_menu_toggle_ignore_enable_hotkey)
59275928
{
59285929
unsigned i;
59295930
/* Autoconf binds are indexed by joy_idx, not frontend port */
@@ -6223,6 +6224,10 @@ static void input_keys_pressed(
62236224
block_hotkey[RARCH_GAME_FOCUS_TOGGLE] = false;
62246225
}
62256226

6227+
/* Never block Menu Toggle if setting is enabled */
6228+
if (input_menu_toggle_ignore_enable_hotkey)
6229+
block_hotkey[RARCH_MENU_TOGGLE] = false;
6230+
62266231
for (i = RARCH_FIRST_META_KEY; i < RARCH_BIND_LIST_END; i++)
62276232
{
62286233
bool other_pressed = input_keys_pressed_other_sources(input_st, i, p_new_state);
@@ -7243,7 +7248,8 @@ void input_driver_collect_system_input(input_driver_state_t *input_st,
72437248
joypad,
72447249
sec_joypad,
72457250
&joypad_info,
7246-
settings->bools.input_hotkey_device_merge);
7251+
settings->bools.input_hotkey_device_merge,
7252+
settings->bools.input_menu_toggle_ignore_enable_hotkey);
72477253

72487254
#ifdef HAVE_MENU
72497255
if (menu_is_alive)

intl/msg_hash_lbl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,10 @@ MSG_HASH(
18861886
MENU_ENUM_LABEL_INPUT_HOTKEY_DEVICE_MERGE,
18871887
"input_hotkey_device_merge"
18881888
)
1889+
MSG_HASH(
1890+
MENU_ENUM_LABEL_INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY,
1891+
"input_menu_toggle_ignore_enable_hotkey"
1892+
)
18891893
MSG_HASH(
18901894
MENU_ENUM_LABEL_INPUT_ICADE_ENABLE,
18911895
"input_icade_enable"

intl/msg_hash_us.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3651,6 +3651,14 @@ MSG_HASH(
36513651
MENU_ENUM_SUBLABEL_INPUT_HOTKEY_FOLLOWS_PLAYER1,
36523652
"Hotkeys are bound to core port 1, even if core port 1 is remapped to a different user. Note: keyboard hotkeys will not work if core port 1 is remapped to any user > 1 (keyboard input is from user 1)."
36533653
)
3654+
MSG_HASH(
3655+
MENU_ENUM_LABEL_VALUE_INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY,
3656+
"Menu Toggle Without Hotkey Enable"
3657+
)
3658+
MSG_HASH(
3659+
MENU_ENUM_SUBLABEL_INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY,
3660+
"Allow Menu Toggle hotkey to work without requiring 'Hotkey Enable' to be held. All other hotkeys still respect 'Hotkey Enable'."
3661+
)
36543662
MSG_HASH(
36553663
MENU_ENUM_LABEL_VALUE_INPUT_MENU_ENUM_TOGGLE_GAMEPAD_COMBO,
36563664
"Menu Toggle (Controller Combo)"

menu/cbs/menu_cbs_sublabel.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_netplay_fade_chat_toggle,
497497
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_hotkey_block_delay, MENU_ENUM_SUBLABEL_INPUT_HOTKEY_BLOCK_DELAY)
498498
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_hotkey_device_merge, MENU_ENUM_SUBLABEL_INPUT_HOTKEY_DEVICE_MERGE)
499499
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_hotkey_follows_player1, MENU_ENUM_SUBLABEL_INPUT_HOTKEY_FOLLOWS_PLAYER1)
500+
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_menu_toggle_ignore_enable_hotkey, MENU_ENUM_SUBLABEL_INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY)
500501
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_device_type, MENU_ENUM_SUBLABEL_INPUT_DEVICE_TYPE)
501502
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_device_index, MENU_ENUM_SUBLABEL_INPUT_DEVICE_INDEX)
502503
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_mouse_index, MENU_ENUM_SUBLABEL_INPUT_MOUSE_INDEX)
@@ -5049,6 +5050,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
50495050
case MENU_ENUM_LABEL_INPUT_HOTKEY_FOLLOWS_PLAYER1:
50505051
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_hotkey_follows_player1);
50515052
break;
5053+
case MENU_ENUM_LABEL_INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY:
5054+
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_menu_toggle_ignore_enable_hotkey);
5055+
break;
50525056
case MENU_ENUM_LABEL_INPUT_USER_1_BINDS:
50535057
case MENU_ENUM_LABEL_INPUT_USER_2_BINDS:
50545058
case MENU_ENUM_LABEL_INPUT_USER_3_BINDS:

menu/menu_displaylist.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7604,6 +7604,10 @@ unsigned menu_displaylist_build_list(
76047604
MENU_ENUM_LABEL_INPUT_HOTKEY_FOLLOWS_PLAYER1,
76057605
PARSE_ONLY_BOOL, false) == 0)
76067606
count++;
7607+
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
7608+
MENU_ENUM_LABEL_INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY,
7609+
PARSE_ONLY_BOOL, false) == 0)
7610+
count++;
76077611

76087612
/* All other binds come last */
76097613
for (i = 0; i < RARCH_BIND_LIST_END; i++)

menu/menu_setting.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15998,6 +15998,22 @@ static bool setting_append_list(
1599815998
SD_FLAG_NONE
1599915999
);
1600016000

16001+
CONFIG_BOOL(
16002+
list, list_info,
16003+
&settings->bools.input_menu_toggle_ignore_enable_hotkey,
16004+
MENU_ENUM_LABEL_INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY,
16005+
MENU_ENUM_LABEL_VALUE_INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY,
16006+
DEFAULT_INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY,
16007+
MENU_ENUM_LABEL_VALUE_OFF,
16008+
MENU_ENUM_LABEL_VALUE_ON,
16009+
&group_info,
16010+
&subgroup_info,
16011+
parent_group,
16012+
general_write_handler,
16013+
general_read_handler,
16014+
SD_FLAG_NONE
16015+
);
16016+
1600116017
CONFIG_BOOL(
1600216018
list, list_info,
1600316019
&settings->bools.input_menu_swap_ok_cancel_buttons,

msg_hash.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ enum msg_hash_enums
921921
MENU_LABEL(INPUT_HOTKEY_BLOCK_DELAY),
922922
MENU_LABEL(INPUT_HOTKEY_DEVICE_MERGE),
923923
MENU_LABEL(INPUT_HOTKEY_FOLLOWS_PLAYER1),
924+
MENU_LABEL(INPUT_MENU_TOGGLE_IGNORE_ENABLE_HOTKEY),
924925
MENU_LABEL(INPUT_SPLIT_JOYCON),
925926

926927
MENU_ENUM_LABEL_INPUT_HOTKEY_BINDS_BEGIN,

0 commit comments

Comments
 (0)