libobs: fix new virtual key codes display

this is required as GetKeyNameText does not translate multimedia keys
and custom OEM keys returning nonsensical one char names
master
Igor Bochkariov 2019-10-02 11:26:39 +04:00 committed by jp9000
parent d822c07dc3
commit ba86eb3bcf
1 changed files with 2 additions and 1 deletions

View File

@ -1075,7 +1075,8 @@ void obs_key_to_str(obs_key_t key, struct dstr *str)
scan_code |= 0x01000000;
}
if (scan_code != 0 && GetKeyNameTextW(scan_code, name, 128) != 0) {
if ((key < OBS_KEY_VK_CANCEL || key > OBS_KEY_VK_OEM_CLEAR) &&
scan_code != 0 && GetKeyNameTextW(scan_code, name, 128) != 0) {
dstr_from_wcs(str, name);
} else if (key != OBS_KEY_NONE) {
dstr_copy(str, obs_key_to_name(key));