Fix Win32 charmods handler not triggering when CTRL is held (fix #672)

This commit is contained in:
ocornut 2015-12-25 21:59:02 +01:00
parent ecd04539ec
commit e786fc8abb

View File

@ -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;
} }