glfwPollEvents() does not invoke key callback

Started by Serg, July 13, 2015, 17:35:11

Previous topic - Next topic

Serg

Hello guys,

Two days ago I installed and set up the LWJGL library (version 3.0.0a) and tried to run the code from the 'getting started' page here: http://www.lwjgl.org/guide

When I run the code on my desktop pc (running Linux Xubuntu 15.04 with JDK 1.8 ), everything works as expected except for one thing: pressing the escape key to close the window doesn't work and neither do any other keyboard buttons (I tried replacing GLFW_KEY_ESCAPE with GLFW_KEY_SPACE and some other keys, none work). I set up a MouseButtonCallback() instead to close the window when mouse button 1 is pressed which DOES work. In other words, my mouse input is recognized but my keyboard input is not.

Another weird thing: The exact same code does not produce this problem on my laptop (which is also running Xubuntu 15.04 with JDK 1.8 ). On my laptop the exact same code allows me to close the window with both the mouse button and the escape key (or any other keyboard key). Both my desktop and laptop use the same keyboard layout (AZERTY).

I also tried printing out the key and action variables inside the key callback. When I press escape on my laptop, it prints "key=256, action=1". On my desktop, it doesn't print any output in the console. In other words, it seems the key callback is not at all triggered by glfwPollEvents() on my desktop computer, yet it is on my laptop.

I am running the exact same code on both computers from a dropbox folder that's synced between both computers.

Does anyone know what might be the cause of this problem? Thanks in advance.


spasi

Hey Serg,

This is a known issue with the latest GLFW builds. I will soon update LWJGL with an older build that does not have this bug.

Serg

Ah, ok. Thanks for the quick response and solution!

spasi

The builds have been updated. Could you please let me know if it works now?

Serg

It works now! Wow, amazing. Thanks for the help and quick fix! ;D