Browse Source

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
Igor Bochkariov 6 years ago
parent
commit
ba86eb3bcf
1 changed files with 2 additions and 1 deletions
  1. 2 1
      libobs/obs-windows.c

+ 2 - 1
libobs/obs-windows.c

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