mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 05:36:35 +00:00
Fix Win32 charmods handler not triggering when CTRL is held (fix #672)
This commit is contained in:
parent
ecd04539ec
commit
e786fc8abb
@ -379,6 +379,18 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
else
|
else
|
||||||
_glfwInputKey(window, key, scancode, action, mods);
|
_glfwInputKey(window, key, scancode, action, mods);
|
||||||
|
|
||||||
|
if ((uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN) && (mods & GLFW_MOD_CONTROL))
|
||||||
|
{
|
||||||
|
static BYTE keys[256] = { 0 };
|
||||||
|
WCHAR buf[4];
|
||||||
|
int buf_sz;
|
||||||
|
int n;
|
||||||
|
keys[VK_SHIFT] = (mods & GLFW_MOD_SHIFT) ? 0x80 : 0;
|
||||||
|
buf_sz = ToUnicodeEx(wParam, scancode, keys, buf, 4, 0, NULL);
|
||||||
|
for (n = 0; n < buf_sz; n++)
|
||||||
|
_glfwInputChar(window, buf[n], getKeyMods(), FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user