mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 03:52:01 +00:00
Win32: Fix key name code changing global key state
This prevents glfwInit from potentially clobbering the dead key state for other applications. Closes #2018
This commit is contained in:
parent
789d2924c0
commit
ad01c1b614
@ -10,6 +10,7 @@ video tutorials.
|
|||||||
- Matt Arsenault
|
- Matt Arsenault
|
||||||
- ashishgamedev
|
- ashishgamedev
|
||||||
- David Avedissian
|
- David Avedissian
|
||||||
|
- Luca Bacci
|
||||||
- Keith Bauer
|
- Keith Bauer
|
||||||
- John Bartholomew
|
- John Bartholomew
|
||||||
- Coşku Baş
|
- Coşku Baş
|
||||||
|
@ -205,6 +205,8 @@ information on what to include when reporting a bug.
|
|||||||
- [Win32] Bugfix: Content scale queries could fail silently (#1615)
|
- [Win32] Bugfix: Content scale queries could fail silently (#1615)
|
||||||
- [Win32] Bugfix: Content scales could have garbage values if monitor was recently
|
- [Win32] Bugfix: Content scales could have garbage values if monitor was recently
|
||||||
disconnected (#1615)
|
disconnected (#1615)
|
||||||
|
- [Win32] Bugfix: Key name update modified global key state on Windows 10 1607
|
||||||
|
and later (#2018)
|
||||||
- [Cocoa] Added support for `VK_EXT_metal_surface` (#1619)
|
- [Cocoa] Added support for `VK_EXT_metal_surface` (#1619)
|
||||||
- [Cocoa] Added locating the Vulkan loader at runtime in an application bundle
|
- [Cocoa] Added locating the Vulkan loader at runtime in an application bundle
|
||||||
- [Cocoa] Moved main menu creation to GLFW initialization time (#1649)
|
- [Cocoa] Moved main menu creation to GLFW initialization time (#1649)
|
||||||
|
@ -458,6 +458,11 @@ void _glfwUpdateKeyNamesWin32(void)
|
|||||||
{
|
{
|
||||||
int key;
|
int key;
|
||||||
BYTE state[256] = {0};
|
BYTE state[256] = {0};
|
||||||
|
UINT flags = 0;
|
||||||
|
|
||||||
|
// Avoid modifying the global key state if supported
|
||||||
|
if (_glfwIsWindows10AnniversaryUpdateOrGreaterWin32())
|
||||||
|
flags = (1 << 2);
|
||||||
|
|
||||||
memset(_glfw.win32.keynames, 0, sizeof(_glfw.win32.keynames));
|
memset(_glfw.win32.keynames, 0, sizeof(_glfw.win32.keynames));
|
||||||
|
|
||||||
@ -487,13 +492,13 @@ void _glfwUpdateKeyNamesWin32(void)
|
|||||||
|
|
||||||
length = ToUnicode(vk, scancode, state,
|
length = ToUnicode(vk, scancode, state,
|
||||||
chars, sizeof(chars) / sizeof(WCHAR),
|
chars, sizeof(chars) / sizeof(WCHAR),
|
||||||
0);
|
flags);
|
||||||
|
|
||||||
if (length == -1)
|
if (length == -1)
|
||||||
{
|
{
|
||||||
length = ToUnicode(vk, scancode, state,
|
length = ToUnicode(vk, scancode, state,
|
||||||
chars, sizeof(chars) / sizeof(WCHAR),
|
chars, sizeof(chars) / sizeof(WCHAR),
|
||||||
0);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length < 1)
|
if (length < 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user