I'm currently using SDL_GetKeyboardState to capture key states once per frame. This works great for input that I want to handle for as long as a key is pressed (i.e character movement) but creates a real problem when I want to respond to a key press only once while the key is held down. Currently, even a rapid key press+release occurs over 2-3 frames, meaning the input is handled that many times instead of just once.
In short, is there a simple way to handle input once when a key is pressed, and then ignore that key until it's released and pressed again?
Just to mention, I've already looked at using event.key.repeat to see if a key has been repeated, but this only seems to work when the key has been pressed for a certain period of time (in my case 10+ frames)
Thanks in advance