Workaround for glfw keyboard issue on linux.

Fixed issue #10
This commit is contained in:
Emil Segerås 2014-05-18 21:46:55 +02:00
parent ebf485e7b8
commit 29f0f68b45

View File

@ -224,10 +224,15 @@ static void key_callback(GLFWwindow *window, int key, int scancode, int action,
key_super = down;
break;
default:
// GLFW has some platform issues with keyboard handling that needs workaround until
// it's fixed properly in glfw. This code must not run on linux with glfw 3.0.4 (it
// has changed several times in the past). issue #10.
#ifndef LINUX
// glfw calls key_callback instead of char_callback
// when pressing a character while ctrl is also pressed.
if (key_ctrl && !key_alt && key >= 32 && key <= 255)
InvokeKey(window, key, TB_KEY_UNDEFINED, modifier, down);
#endif
break;
}
}