Skip to content

Commit

Permalink
Show also lightgun bind labels instead of only 'N/A'
Browse files Browse the repository at this point in the history
  • Loading branch information
sonninnos committed Jul 30, 2023
1 parent cf42a20 commit 8548db2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 4 additions & 5 deletions config.def.keybinds.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
{
Expand Down Expand Up @@ -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
},
{
Expand Down Expand Up @@ -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
},
{
Expand Down Expand Up @@ -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
},
{
Expand Down
9 changes: 6 additions & 3 deletions menu/menu_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 8548db2

Please sign in to comment.