mirror of
https://github.com/godotengine/godot.git
synced 2024-11-29 07:32:20 +00:00
Merge pull request #1437 from Hinsbart/fix_win_joy
fix get joystick name from registry on some systems
This commit is contained in:
commit
440cc5e4b6
@ -715,9 +715,14 @@ String OS_Windows::get_joystick_name(int id, JOYCAPS jcaps)
|
||||
return "";
|
||||
|
||||
_snprintf( buffer, sizeof(buffer), "%s\\%s", REGSTR_PATH_JOYOEM, OEM);
|
||||
res = RegOpenKeyEx ( HKEY_LOCAL_MACHINE, buffer, 0, KEY_QUERY_VALUE, &hKey);
|
||||
if (res != ERROR_SUCCESS)
|
||||
return "";
|
||||
res = RegOpenKeyEx(HKEY_LOCAL_MACHINE, buffer, 0, KEY_QUERY_VALUE, &hKey);
|
||||
if (res != ERROR_SUCCESS)
|
||||
{
|
||||
res = RegOpenKeyEx(HKEY_CURRENT_USER, buffer, 0, KEY_QUERY_VALUE, &hKey);
|
||||
if (res != ERROR_SUCCESS)
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
sz = sizeof(buffer);
|
||||
res = RegQueryValueEx(hKey, REGSTR_VAL_JOYOEMNAME, 0, 0, (LPBYTE) buffer,
|
||||
|
Loading…
Reference in New Issue
Block a user