Keyboard input issues

Dec 12, 2011 at 5:03pm
I am trying to create a game using Dev C++ as my IDE. I am currently using Dev's OpenGL template. I would like to be able to catch all key presses. One issue I am having is that when I hold down a key it triggers one hit, waits for half a second and then continuously triggers the key press. I want there to be no break but I don't know how to fix that issue. Resolving that may fix my next issue, but I'm not sure. I want to also allow two keys to be pressed at the same time and have both events triggered. Does anyone know how to fix these issues?
Dec 12, 2011 at 5:13pm
First:
http://www.cplusplus.com/articles/36vU7k9E/

As for your lesser problem, it's just the way windows' repeat delay works. You must be using the wrong kind of events for the key presses...
Last edited on Dec 12, 2011 at 5:14pm
Dec 12, 2011 at 8:33pm
That is not something that your program should be messing with.
It is better to track key down and key up events for the specific keys you are interested in (like the arrow keys). Then your timed event handler can react based upon the keys that are currently pressed, etc.
Topic archived. No new replies allowed.