diff --git a/configuration.c b/configuration.c index 8335986000b..ad3030c5752 100644 --- a/configuration.c +++ b/configuration.c @@ -1899,6 +1899,8 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("menu_unified_controls", &settings->bools.menu_unified_controls, true, false, false); SETTING_BOOL("menu_disable_info_button", &settings->bools.menu_disable_info_button, true, false, false); SETTING_BOOL("menu_disable_search_button", &settings->bools.menu_disable_search_button, true, false, false); + SETTING_BOOL("menu_disable_left_analog", &settings->bools.menu_disable_left_analog, true, false, false); + SETTING_BOOL("menu_disable_right_analog", &settings->bools.menu_disable_right_analog, true, false, false); SETTING_BOOL("menu_linear_filter", &settings->bools.menu_linear_filter, true, DEFAULT_VIDEO_SMOOTH, false); SETTING_BOOL("menu_horizontal_animation", &settings->bools.menu_horizontal_animation, true, DEFAULT_MENU_HORIZONTAL_ANIMATION, false); SETTING_BOOL("menu_pause_libretro", &settings->bools.menu_pause_libretro, true, true, false); diff --git a/configuration.h b/configuration.h index e027903a8db..2c1732419db 100644 --- a/configuration.h +++ b/configuration.h @@ -821,6 +821,8 @@ typedef struct settings bool menu_unified_controls; bool menu_disable_info_button; bool menu_disable_search_button; + bool menu_disable_left_analog; + bool menu_disable_right_analog; bool menu_ticker_smooth; bool settings_show_drivers; bool settings_show_video; diff --git a/input/input_driver.c b/input/input_driver.c index 33fafc37d72..7ac1c6e308b 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -6786,7 +6786,7 @@ void input_driver_collect_system_input(input_driver_state_t *input_st, (general_binds)[k].orig_joyaxis = (general_binds)[k].joyaxis; } - /* Read input from both analog sticks. */ + /* Read input from analog sticks according to settings. */ for (s = RETRO_DEVICE_INDEX_ANALOG_LEFT; s <= RETRO_DEVICE_INDEX_ANALOG_RIGHT; s++) { unsigned x_plus = RARCH_ANALOG_LEFT_X_PLUS; @@ -6794,6 +6794,9 @@ void input_driver_collect_system_input(input_driver_state_t *input_st, unsigned x_minus = RARCH_ANALOG_LEFT_X_MINUS; unsigned y_minus = RARCH_ANALOG_LEFT_Y_MINUS; + if ((settings->bools.menu_disable_left_analog && s == RETRO_DEVICE_INDEX_ANALOG_LEFT ) || + (settings->bools.menu_disable_right_analog && s == RETRO_DEVICE_INDEX_ANALOG_RIGHT)) + continue; if (s == RETRO_DEVICE_INDEX_ANALOG_RIGHT) { x_plus = RARCH_ANALOG_RIGHT_X_PLUS; diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 484f3bce255..bc434ce0cb9 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -5010,6 +5010,14 @@ MSG_HASH( MENU_ENUM_LABEL_INPUT_DISABLE_SEARCH_BUTTON, "disable_search_button" ) +MSG_HASH( + MENU_ENUM_LABEL_INPUT_DISABLE_LEFT_ANALOG_IN_MENU, + "disable_left_analog_in_menu" + ) +MSG_HASH( + MENU_ENUM_LABEL_INPUT_DISABLE_RIGHT_ANALOG_IN_MENU, + "disable_right_analog_in_menu" + ) MSG_HASH( MENU_ENUM_LABEL_QUIT_PRESS_TWICE, "quit_press_twice" diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 0faeea183ee..37b5773f30a 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3655,6 +3655,22 @@ MSG_HASH( MENU_ENUM_SUBLABEL_INPUT_DISABLE_SEARCH_BUTTON, "If enabled Search button presses will be ignored." ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_INPUT_DISABLE_LEFT_ANALOG_IN_MENU, + "Disable Left Analog in Menu" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_INPUT_DISABLE_LEFT_ANALOG_IN_MENU, + "Prevent Left Analog stick from navigating in menu." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_INPUT_DISABLE_RIGHT_ANALOG_IN_MENU, + "Disable Right Analog in Menu" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_INPUT_DISABLE_RIGHT_ANALOG_IN_MENU, + "Prevent Right Analog stick from navigating in menu." + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_MENU_INPUT_SWAP_OK_CANCEL, "Menu Swap OK and Cancel Buttons" diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 43058d5ea7b..51d67523ebe 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -599,6 +599,8 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_content_favorites_size, MENU_ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_input_unified_controls, MENU_ENUM_SUBLABEL_INPUT_UNIFIED_MENU_CONTROLS) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_input_disable_info_button, MENU_ENUM_SUBLABEL_INPUT_DISABLE_INFO_BUTTON) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_input_disable_search_button, MENU_ENUM_SUBLABEL_INPUT_DISABLE_SEARCH_BUTTON) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_input_disable_left_analog_in_menu, MENU_ENUM_SUBLABEL_INPUT_DISABLE_LEFT_ANALOG_IN_MENU) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_input_disable_right_analog_in_menu, MENU_ENUM_SUBLABEL_INPUT_DISABLE_RIGHT_ANALOG_IN_MENU) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quit_press_twice, MENU_ENUM_SUBLABEL_QUIT_PRESS_TWICE) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_onscreen_notifications_enable, MENU_ENUM_SUBLABEL_VIDEO_FONT_ENABLE) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_crop_overscan, MENU_ENUM_SUBLABEL_VIDEO_CROP_OVERSCAN) @@ -4506,6 +4508,12 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_INPUT_DISABLE_SEARCH_BUTTON: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_input_disable_search_button); break; + case MENU_ENUM_LABEL_INPUT_DISABLE_LEFT_ANALOG_IN_MENU: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_input_disable_left_analog_in_menu); + break; + case MENU_ENUM_LABEL_INPUT_DISABLE_RIGHT_ANALOG_IN_MENU: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_input_disable_right_analog_in_menu); + break; case MENU_ENUM_LABEL_QUIT_PRESS_TWICE: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_quit_press_twice); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 3aed5bdb082..794e955bcc1 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -7923,14 +7923,16 @@ unsigned menu_displaylist_build_list( case DISPLAYLIST_INPUT_MENU_SETTINGS_LIST: { menu_displaylist_build_info_selective_t build_list[] = { - {MENU_ENUM_LABEL_INPUT_UNIFIED_MENU_CONTROLS, PARSE_ONLY_BOOL, true }, - {MENU_ENUM_LABEL_MENU_INPUT_SWAP_OK_CANCEL, PARSE_ONLY_BOOL, true }, - {MENU_ENUM_LABEL_MENU_INPUT_SWAP_SCROLL, PARSE_ONLY_BOOL, true }, - {MENU_ENUM_LABEL_INPUT_ALL_USERS_CONTROL_MENU, PARSE_ONLY_BOOL, true }, - {MENU_ENUM_LABEL_MENU_SCROLL_FAST, PARSE_ONLY_BOOL, true }, - {MENU_ENUM_LABEL_MENU_SCROLL_DELAY, PARSE_ONLY_UINT, true }, - {MENU_ENUM_LABEL_INPUT_DISABLE_INFO_BUTTON, PARSE_ONLY_BOOL, true }, - {MENU_ENUM_LABEL_INPUT_DISABLE_SEARCH_BUTTON, PARSE_ONLY_BOOL, true }, + {MENU_ENUM_LABEL_INPUT_UNIFIED_MENU_CONTROLS, PARSE_ONLY_BOOL, true }, + {MENU_ENUM_LABEL_MENU_INPUT_SWAP_OK_CANCEL, PARSE_ONLY_BOOL, true }, + {MENU_ENUM_LABEL_MENU_INPUT_SWAP_SCROLL, PARSE_ONLY_BOOL, true }, + {MENU_ENUM_LABEL_INPUT_ALL_USERS_CONTROL_MENU, PARSE_ONLY_BOOL, true }, + {MENU_ENUM_LABEL_MENU_SCROLL_FAST, PARSE_ONLY_BOOL, true }, + {MENU_ENUM_LABEL_MENU_SCROLL_DELAY, PARSE_ONLY_UINT, true }, + {MENU_ENUM_LABEL_INPUT_DISABLE_INFO_BUTTON, PARSE_ONLY_BOOL, true }, + {MENU_ENUM_LABEL_INPUT_DISABLE_SEARCH_BUTTON, PARSE_ONLY_BOOL, true }, + {MENU_ENUM_LABEL_INPUT_DISABLE_LEFT_ANALOG_IN_MENU, PARSE_ONLY_BOOL, true }, + {MENU_ENUM_LABEL_INPUT_DISABLE_RIGHT_ANALOG_IN_MENU, PARSE_ONLY_BOOL, true }, }; for (i = 0; i < ARRAY_SIZE(build_list); i++) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index a92f2bca800..1a91f386a2a 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -15132,6 +15132,38 @@ static bool setting_append_list( SD_FLAG_ADVANCED ); + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_disable_left_analog, + MENU_ENUM_LABEL_INPUT_DISABLE_LEFT_ANALOG_IN_MENU, + MENU_ENUM_LABEL_VALUE_INPUT_DISABLE_LEFT_ANALOG_IN_MENU, + false, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_ADVANCED + ); + + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_disable_right_analog, + MENU_ENUM_LABEL_INPUT_DISABLE_RIGHT_ANALOG_IN_MENU, + MENU_ENUM_LABEL_VALUE_INPUT_DISABLE_RIGHT_ANALOG_IN_MENU, + false, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_ADVANCED + ); + CONFIG_BOOL( list, list_info, &settings->bools.quit_press_twice, diff --git a/msg_hash.h b/msg_hash.h index b38471c158c..06c54952f3d 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1352,6 +1352,8 @@ enum msg_hash_enums MENU_LABEL(INPUT_UNIFIED_MENU_CONTROLS), MENU_LABEL(INPUT_DISABLE_INFO_BUTTON), MENU_LABEL(INPUT_DISABLE_SEARCH_BUTTON), + MENU_LABEL(INPUT_DISABLE_LEFT_ANALOG_IN_MENU), + MENU_LABEL(INPUT_DISABLE_RIGHT_ANALOG_IN_MENU), MENU_LABEL(INPUT_RUMBLE_GAIN), MENU_LABEL(QUIT_PRESS_TWICE),