diff options
author | Anton Yabchinskiy <arn@bestmx.ru> | 2015-03-10 11:44:40 +0300 |
---|---|---|
committer | Anton Yabchinskiy <arn@bestmx.ru> | 2015-03-10 11:44:40 +0300 |
commit | 43713810deaadfec6a1656767cf5520073e58a06 (patch) | |
tree | 8b1c7e82562494e1889b1550b58b3d953f076696 /platform/windows/os_windows.cpp | |
parent | 19a99afa81354ed69e1c07b6050aeb438e4ee2cb (diff) | |
parent | 91744e9ed3124ca48e0837ee72bfe7182fd31701 (diff) |
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'platform/windows/os_windows.cpp')
-rw-r--r-- | platform/windows/os_windows.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 13f2c32e77..e392a56aa8 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -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, |