I am trying to make a small game using (for free) GLUT. I know that it is old and there are better alternatives, but for now I prefer to stick with it and use it as much as possible. I am programming with C.
I'm currently trying to get GLUT to correctly recognize all the keys that I press. I use glutKeyboardFunc, glutKeyboardUpFunc, glutSpecialFunc and glutSpecialUpFunc to detect keystrokes, and I save their state in the short array that I created (currently I have only 5 keys used, so I just created a specific array for them).
However, if everything works fine for 2 keys or less, the game does not properly detect 3 keys or more. Although for some keys it correctly determines the combination (which actually happens for only one specific combination), for others, the functions simply do not detect the third key that I press.
I checked my code several times, and there is nothing special about the combination that works. I also made glutKeyboardFunc and glutSpecialFunc directly print every keystroke they receive, and it seems that they just stop working after I press more than two keys.
Is this a known issue with GLUT or something else? I googled a lot and did not find anyone with a similar problem.
source share