GlfwSetKeyCallback not working for me

archwi wrote on Friday, July 31, 2015:

Hi,

Setting up a basic GLFW example as in http://www.glfw.org/docs/latest/quick.html works, except the key callback function is never called. I’ve tried adding callbacks for mouse button and window_close etc and they all register fine. I’ve tried googling the issue, but it does not seem to be a common issue… Setting up a character_callback works…

I haven’t had this issue with other window libraries (like SDL2). Anyone got any ideas that I could try?

I’m using a mechanical keyboard (filco) on a Linux Mint 17.2 64 bit system.

Relevant test code pasted at http://justpaste.it/mpan

arampl wrote on Friday, July 31, 2015:

Hi!
Not a GLFW issue.

I’ve compiled it on Xubuntu 15.04 64-bit. All OK.

BTW, why do you need CPP for this simple C program? Only for “cout”?

Also, if you don’t need to support ancient hardware, consider to replace all this long ago deprecated stuff such as “glMatrix”, “glVertex” and other immediate mode functions with modern approach - it will save you tons of reworking later.

elmindreda wrote on Friday, July 31, 2015:

Anyone got any ideas that I could try?

Wait for the fix or use a stable release.

archwi wrote on Friday, July 31, 2015:

Thanks for your warning, I wholeheartedly agree on not using legacy GL. I just copy pasted tutorial code to see if everything worked as it should. If you look at the code, you’ll also see that I set up a 4.5 context (commented out) in order to ensure that it wouldn’t give me any issues. Legacy GL is okay for spitting out some quick vertices.

And no, I did not specificly target C++ for cout, it’s just my default language. :slight_smile:

archwi wrote on Friday, July 31, 2015:

Thanks, I tried the demo code on my laptop (same os) and had the same issues. Both cases pulled glfw straight from github. I’ll check out a stable release and see if that fixes it!

Is the master branch typically this unstable?

archwi wrote on Friday, July 31, 2015:

No issue with 3.1.1 stable release. Thanks Camilla.

elmindreda wrote on Sunday, August 02, 2015:

Not typically, no.

elmindreda wrote on Sunday, August 09, 2015:

This has been fixed.