From dbdcf1482eb2fec5e96c0fd9ea543cd4b9e8d49f Mon Sep 17 00:00:00 2001 From: sonninnos <45124675+sonninnos@users.noreply.github.com> Date: Mon, 31 Jul 2023 06:12:21 +0300 Subject: [PATCH] Show also lightgun bind labels instead of only 'N/A' (#15535) --- config.def.keybinds.h | 9 ++++----- menu/menu_setting.c | 9 ++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/config.def.keybinds.h b/config.def.keybinds.h index 4ccf9029cb..d86c8b6413 100644 --- a/config.def.keybinds.h +++ b/config.def.keybinds.h @@ -201,9 +201,8 @@ static const struct retro_keybind retro_keybinds_1[] = { { NULL, NULL, AXIS_NONE, AXIS_NONE, AXIS_NONE, - RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, - NO_BTN, NO_BTN, 0, + RARCH_LIGHTGUN_RELOAD, RETRO_DEVICE_ID_MOUSE_RIGHT, NO_BTN, 0, true }, { @@ -838,7 +837,7 @@ static const struct retro_keybind retro_keybinds_1[] = { NULL, NULL, AXIS_NONE, AXIS_NONE, AXIS_NONE, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, - RARCH_LIGHTGUN_RELOAD, NO_BTN, NO_BTN, 0, + RARCH_LIGHTGUN_RELOAD, RETRO_DEVICE_ID_MOUSE_RIGHT, NO_BTN, 0, true }, { @@ -1473,7 +1472,7 @@ static const struct retro_keybind retro_keybinds_1[] = { NULL, NULL, AXIS_NONE, AXIS_NONE, AXIS_NONE, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, - RARCH_LIGHTGUN_RELOAD, NO_BTN, NO_BTN, 0, + RARCH_LIGHTGUN_RELOAD, RETRO_DEVICE_ID_MOUSE_RIGHT, NO_BTN, 0, true }, { @@ -2122,7 +2121,7 @@ static const struct retro_keybind retro_keybinds_rest[] = { NULL, NULL, AXIS_NONE, AXIS_NONE, AXIS_NONE, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, - RARCH_LIGHTGUN_RELOAD, NO_BTN, NO_BTN, 0, + RARCH_LIGHTGUN_RELOAD, RETRO_DEVICE_ID_MOUSE_RIGHT, NO_BTN, 0, true }, { diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 19809605d3..ad1466dbe1 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -757,9 +757,9 @@ static int setting_bind_action_start(rarch_setting_t *setting) def_binds = (struct retro_keybind*)retro_keybinds_rest; bind_type = setting->bind_type; - keybind->key = def_binds[bind_type - MENU_SETTINGS_BIND_BEGIN].key; - keybind->mbutton = NO_BTN; + keybind->key = def_binds[bind_type - MENU_SETTINGS_BIND_BEGIN].key; + keybind->mbutton = def_binds[bind_type - MENU_SETTINGS_BIND_BEGIN].mbutton; /* Store new mapping bit */ input_keyboard_mapping_bits(1, keybind->key); @@ -9143,7 +9143,10 @@ static bool setting_append_list_input_player_options( sizeof(label) - _len); else { - strlcpy(label + _len, value_na, sizeof(label) - _len); + snprintf(label, sizeof(label), "%s (%s)", + input_config_bind_map_get_desc(i), + value_na); + if (settings->bools.input_descriptor_hide_unbound) continue; }