Merge pull request #5775 from hiddenasbestos/blank_bind

Show "---" for unbound controls, not "(Key: )"
This commit is contained in:
Twinaphex 2017-11-24 23:25:34 +01:00 committed by GitHub
commit f929a83ae9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)