Skip to content

Commit

Permalink
Fix Win32 charmods handler not triggering when CTRL is held (fix glfw…
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Dec 25, 2015
1 parent ecd0453 commit e786fc8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/win32_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,18 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
else
_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;
}

Expand Down

0 comments on commit e786fc8

Please sign in to comment.