Fixed and clarified invalid char tests.

This commit is contained in:
Camilla Berglund 2013-03-07 17:12:43 +01:00
parent 2469a1bac9
commit aec952e8dc

View File

@ -140,8 +140,10 @@ void _glfwInputKey(_GLFWwindow* window, int key, int action)
void _glfwInputChar(_GLFWwindow* window, unsigned int character) void _glfwInputChar(_GLFWwindow* window, unsigned int character)
{ {
// Valid Unicode (ISO 10646) character? if (character == -1)
if (!((character >= 32 && character <= 126) || character >= 160)) return;
if (character < 32 || (character > 126 && character < 160))
return; return;
if (window->callbacks.character) if (window->callbacks.character)