From b12c97392275eb699c22b6cffe6bb32eea3171cd Mon Sep 17 00:00:00 2001 From: siavash Date: Mon, 15 Jul 2013 18:28:09 +0200 Subject: [PATCH] Moved X11 character translation failure test. --- src/input.c | 3 --- src/x11_window.c | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/input.c b/src/input.c index de4ed793..85982419 100644 --- a/src/input.c +++ b/src/input.c @@ -154,9 +154,6 @@ void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int m void _glfwInputChar(_GLFWwindow* window, unsigned int character) { - if (character == -1) - return; - if (character < 32 || (character > 126 && character < 160)) return; diff --git a/src/x11_window.c b/src/x11_window.c index 72c79ab1..604b3077 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -520,7 +520,11 @@ static void processEvent(XEvent *event) _glfwInputKey(window, key, event->xkey.keycode, GLFW_PRESS, mods); if (!(mods & GLFW_MOD_CONTROL) && !(mods & GLFW_MOD_ALT)) - _glfwInputChar(window, translateChar(&event->xkey)); + { + const int character = translateChar(&event->xkey); + if (character != -1) + _glfwInputChar(window, character); + } break; }