Skip to content

Commit

Permalink
Merge pull request #8903 from Ryunam/toggle-showmouse-overlay
Browse files Browse the repository at this point in the history
Add toggle to show/hide mouse cursor with overlays
  • Loading branch information
hizzlekizzle committed Jun 3, 2019
2 parents 717c5c1 + ed1d98d commit de3c1b8
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.def.h
Expand Up @@ -263,6 +263,7 @@ static const unsigned int def_user_language = 0;
#define DEFAULT_SHOW_HIDDEN_FILES false

#define DEFAULT_OVERLAY_HIDE_IN_MENU true
#define DEFAULT_OVERLAY_SHOW_MOUSE_CURSOR true

#define DEFAULT_DISPLAY_KEYBOARD_OVERLAY false

Expand Down
1 change: 1 addition & 0 deletions configuration.c
Expand Up @@ -1569,6 +1569,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("input_overlay_enable_autopreferred", &settings->bools.input_overlay_enable_autopreferred, true, true, false);
SETTING_BOOL("input_overlay_show_physical_inputs", &settings->bools.input_overlay_show_physical_inputs, true, false, false);
SETTING_BOOL("input_overlay_hide_in_menu", &settings->bools.input_overlay_hide_in_menu, true, DEFAULT_OVERLAY_HIDE_IN_MENU, false);
SETTING_BOOL("input_overlay_show_mouse_cursor", &settings->bools.input_overlay_show_mouse_cursor, true, DEFAULT_OVERLAY_SHOW_MOUSE_CURSOR, false);
#endif
#ifdef HAVE_VIDEO_LAYOUT
SETTING_BOOL("video_layout_enable", &settings->bools.video_layout_enable, true, true, false);
Expand Down
1 change: 1 addition & 0 deletions configuration.h
Expand Up @@ -129,6 +129,7 @@ typedef struct settings
bool input_overlay_enable_autopreferred;
bool input_overlay_hide_in_menu;
bool input_overlay_show_physical_inputs;
bool input_overlay_show_mouse_cursor;
bool input_descriptor_label_show;
bool input_descriptor_hide_unbound;
bool input_all_users_control_menu;
Expand Down
5 changes: 5 additions & 0 deletions input/input_overlay.c
Expand Up @@ -602,6 +602,7 @@ void input_overlay_loaded(retro_task_t *task,
overlay_task_data_t *data = (overlay_task_data_t*)task_data;
input_overlay_t *ol = NULL;
const video_overlay_interface_t *iface = NULL;
settings_t *settings = config_get_ptr();

if (err)
return;
Expand Down Expand Up @@ -642,6 +643,10 @@ void input_overlay_loaded(retro_task_t *task,
overlay_ptr = ol;

free(data);

if (!settings->bools.input_overlay_show_mouse_cursor)
video_driver_hide_mouse();

return;

abort_load:
Expand Down
2 changes: 2 additions & 0 deletions intl/msg_hash_lbl.h
Expand Up @@ -571,6 +571,8 @@ MSG_HASH(MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS,
"overlay_show_physical_inputs")
MSG_HASH(MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,
"overlay_show_physical_inputs_port")
MSG_HASH(MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_MOUSE_CURSOR,
"overlay_show_mouse_cursor")
MSG_HASH(MENU_ENUM_LABEL_INPUT_PLAYER_ANALOG_DPAD_MODE,
"input_player%u_analog_dpad_mode")
MSG_HASH(MENU_ENUM_LABEL_INPUT_POLL_TYPE_BEHAVIOR,
Expand Down
8 changes: 8 additions & 0 deletions intl/msg_hash_us.h
Expand Up @@ -1420,6 +1420,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS,
"Show Inputs On Overlay"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_SHOW_MOUSE_CURSOR,
"Show Mouse Cursor With Overlay"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,
"Show Inputs Listen Port"
Expand Down Expand Up @@ -5516,6 +5520,10 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,
"Select the port for the overlay to listen to if Show Inputs On Overlay is enabled."
)
MSG_HASH(
MENU_ENUM_SUBLABEL_INPUT_OVERLAY_SHOW_MOUSE_CURSOR,
"Show the mouse cursor when using an onscreen overlay."
)
MSG_HASH(
MENU_ENUM_SUBLABEL_PLAYLISTS_TAB,
"Scanned content matching the database will appear here."
Expand Down
4 changes: 4 additions & 0 deletions menu/cbs/menu_cbs_sublabel.c
Expand Up @@ -250,6 +250,7 @@ default_sublabel_macro(action_bind_sublabel_video_message_pos_x, MENU_
default_sublabel_macro(action_bind_sublabel_video_message_pos_y, MENU_ENUM_SUBLABEL_VIDEO_MESSAGE_POS_Y)
default_sublabel_macro(action_bind_sublabel_video_font_size, MENU_ENUM_SUBLABEL_VIDEO_FONT_SIZE)
default_sublabel_macro(action_bind_sublabel_input_overlay_hide_in_menu, MENU_ENUM_SUBLABEL_INPUT_OVERLAY_HIDE_IN_MENU)
default_sublabel_macro(action_bind_sublabel_input_overlay_show_mouse_cursor, MENU_ENUM_SUBLABEL_INPUT_OVERLAY_SHOW_MOUSE_CURSOR)
default_sublabel_macro(action_bind_sublabel_content_collection_list, MENU_ENUM_SUBLABEL_PLAYLISTS_TAB)
default_sublabel_macro(action_bind_sublabel_video_scale_integer, MENU_ENUM_SUBLABEL_VIDEO_SCALE_INTEGER)
default_sublabel_macro(action_bind_sublabel_video_gpu_screenshot, MENU_ENUM_SUBLABEL_VIDEO_GPU_SCREENSHOT)
Expand Down Expand Up @@ -2018,6 +2019,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_overlay_show_physical_inputs_port);
break;
case MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_MOUSE_CURSOR:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_overlay_show_mouse_cursor);
break;
case MENU_ENUM_LABEL_VIDEO_FONT_SIZE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_font_size);
break;
Expand Down
1 change: 1 addition & 0 deletions menu/menu_displaylist.c
Expand Up @@ -3889,6 +3889,7 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
{MENU_ENUM_LABEL_INPUT_OVERLAY_HIDE_IN_MENU, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT,PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_MOUSE_CURSOR, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_OVERLAY_PRESET, PARSE_ONLY_PATH },
{MENU_ENUM_LABEL_OVERLAY_OPACITY, PARSE_ONLY_FLOAT },
{MENU_ENUM_LABEL_OVERLAY_SCALE, PARSE_ONLY_FLOAT },
Expand Down
16 changes: 16 additions & 0 deletions menu/menu_setting.c
Expand Up @@ -10703,6 +10703,22 @@ static bool setting_append_list(
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
menu_settings_list_current_add_range(list, list_info, 0, MAX_USERS - 1, 1, true, true);

CONFIG_BOOL(
list, list_info,
&settings->bools.input_overlay_show_mouse_cursor,
MENU_ENUM_LABEL_INPUT_OVERLAY_SHOW_MOUSE_CURSOR,
MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_SHOW_MOUSE_CURSOR,
DEFAULT_OVERLAY_SHOW_MOUSE_CURSOR,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler,
SD_FLAG_NONE
);

CONFIG_PATH(
list, list_info,
settings->paths.path_overlay,
Expand Down
1 change: 1 addition & 0 deletions msg_hash.h
Expand Up @@ -777,6 +777,7 @@ enum msg_hash_enums
MENU_LABEL(INPUT_OVERLAY_HIDE_IN_MENU),
MENU_LABEL(INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS),
MENU_LABEL(INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS_PORT),
MENU_LABEL(INPUT_OVERLAY_SHOW_MOUSE_CURSOR),
MENU_LABEL(INPUT_KEYBOARD_GAMEPAD_MAPPING_TYPE),
MENU_LABEL(INPUT_SMALL_KEYBOARD_ENABLE),
MENU_LABEL(INPUT_TOUCH_ENABLE),
Expand Down

0 comments on commit de3c1b8

Please sign in to comment.