From 9c20737b60037dbbda5552a45b5af9e1314cc701 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 19 Aug 2013 13:08:35 +0200 Subject: [PATCH] Allowed characters regardless of modifier keys. --- README.md | 1 + src/cocoa_window.m | 3 --- src/win32_window.c | 1 + src/x11_window.c | 9 +++------ 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 73230463..420a84fc 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,7 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/). ## Changelog + - Allowed character callback to be triggered regardless of modifier keys - Bugfix: The `-Wall` flag was not used with Clang and other GCC compatibles - Bugfix: The default for `GLFW_ALPHA_BITS` was set to zero - [Win32] Added `_GLFW_USE_DWM_SWAP_INTERVAL` for forcing the swap interval diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 4a2c0c35..6bdba4bb 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -566,9 +566,6 @@ static int translateKey(unsigned int key) const int mods = translateFlags([event modifierFlags]); _glfwInputKey(window, key, [event keyCode], GLFW_PRESS, mods); - if (mods & GLFW_MOD_SUPER) - return; - NSString* characters = [event characters]; NSUInteger i, length = [characters length]; diff --git a/src/win32_window.c b/src/win32_window.c index 7b1ce655..139e661d 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -480,6 +480,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, } case WM_CHAR: + case WM_SYSCHAR: { _glfwInputChar(window, (unsigned int) wParam); return 0; diff --git a/src/x11_window.c b/src/x11_window.c index 9b3791c2..33c4b8e4 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -513,15 +513,12 @@ static void processEvent(XEvent *event) { const int key = translateKey(event->xkey.keycode); const int mods = translateState(event->xkey.state); + const int character = translateChar(&event->xkey); _glfwInputKey(window, key, event->xkey.keycode, GLFW_PRESS, mods); - if (!(mods & GLFW_MOD_CONTROL) && !(mods & GLFW_MOD_ALT)) - { - const int character = translateChar(&event->xkey); - if (character != -1) - _glfwInputChar(window, character); - } + if (character != -1) + _glfwInputChar(window, character); break; }