Skip to content

Commit

Permalink
Merge pull request libretro#5775 from hiddenasbestos/blank_bind
Browse files Browse the repository at this point in the history
Show "---" for unbound controls, not "(Key: )"
  • Loading branch information
inactive123 authored Nov 24, 2017
2 parents 5a6aad3 + b3a53ac commit f929a83
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions input/input_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2511,10 +2511,17 @@ void input_config_get_bind_string(char *buf, const struct retro_keybind *bind,
input_keymaps_translate_rk_to_str(bind->key, key, sizeof(key));
if (string_is_equal(key, file_path_str(FILE_PATH_NUL)))
*key = '\0';

snprintf(keybuf, sizeof(keybuf), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_KEY), key);
strlcat(buf, keybuf, size);
/*empty?*/
if ( *key != '\0' ) {
snprintf(keybuf, sizeof(keybuf), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_KEY), key);
strlcat(buf, keybuf, size);
}
#endif

/*completely empty?*/
if ( *buf == '\0' ) {
strlcat(buf, "---", size);
}
}

const char *input_config_get_device_name(unsigned port)
Expand Down

0 comments on commit f929a83

Please sign in to comment.