Windows: avoid modifying the global keyboard state with ToUnicode

Since Windows 10 version 1607 we can make use of a new flag that
makes ToUnicode operate on a process-private keyboard state.

Reference:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-tounicode
This commit is contained in:
Luca Bacci 2021-12-29 15:08:29 +01:00
parent 7d060ba4f1
commit b2ca22e51b
No known key found for this signature in database
GPG Key ID: 8E3C8D989C98883D

View File

@ -487,13 +487,13 @@ void _glfwUpdateKeyNamesWin32(void)
length = ToUnicode(vk, scancode, state,
chars, sizeof(chars) / sizeof(WCHAR),
0);
1 << 2);
if (length == -1)
{
length = ToUnicode(vk, scancode, state,
chars, sizeof(chars) / sizeof(WCHAR),
0);
1 << 2);
}
if (length < 1)