This is a similar problem: Link
Which was solved by calling GetAsyncKeyState(). While all fine and dandy, I need a Linux alternative. I need to know if a button is being held down, not just being pressed (because of the keyboard buffer delay).
Does anything like this exist in the OpenGL/Glut libraries, or will I have to look elsewhere?
I have never used Glut, but I know that many people will say SDL is better. I have used SDL and I like it a lot. It does everything Glut does and a lot more. In SDL, you can use
SDL_PollEvent()to get key state without the keyboard buffer delay.Edit: I know almost nothing about Glut, but it looks like you can use
glutKeyboardFuncto detect normal keys, andglutSpecialFuncfor keys that do not generate ASCII characters (such as shift). I’m not sure if there is a better way, as this doesn’t seem very nice.