Keyboard callbacks blocks mouse button callback

Hey guys, I can’t find anything on this on Google, I am not quite sure what I am doing wrong.

So I have two methods setup to register key presses using the glfwSetMouseButtonCallback and glfwSetKeyCallback. The methods are in this file,

The call backs work fine on their own, used in combination, they also work fine one way but not the other way around. If I press for example the right mouse key, hold and press for example keyboard S key, I get callbacks from both mouse and keyboard, but if I hold S key first and then click the mouse button right, I wont get callback for mouse button, only for the keyboard key. Then after I let go of the S key, I need to press the mouse button at least twice to get a callback. Keyboad with Keyboard works without a problem.

I am on windows 10, visual studio 2018 and GLFW 3.3. The binding of my function with the callback happens in the constructor of the InputMaster. InputMaster is created in Application.cpp

Any ideas what I am doing wrong? Btw I am printing out these information first thing as the callback is called, so I doubt the issue is on the abstraction I am adding on top.

Your code is a little complicated to follow with a quick look. I suggest some practical debugging:

  1. Add printf’s to the OnKeyPressed and OnMouseButtonPressed making sure you output all information and do so before any of your code.
  2. Use break points to check code flow when a key/mouse button is pressed.

Thanks for the reply.
I print first thing in OnKeyPressed and OnMouseButtonPressed before any of my code. The mouse button callback is not called at all if a keyboard key is pressed. Same thing with break points, it never gets to a line I can set, since the callback itself is not called.
Interesting thing is, I tested the code on a different machine at work, and the callback is called without any problems there. Both windows/ visual studio 2018.

There is a test called events.c in the glfw tests code folder. If you can run this you can use it to verify whether GLFW is getting the inputs correctly.