Sure, implement something like the following:
boolean F12_DOWN = false ;
if(F12_DOWN == false)
F12_DOWN = true ;
F12_DOWN = false ;
This is kind of what I had. The thing is, if your game does 200 FPS (...9700 Pro
) and you push the button for 1/4 second, the F12_DOWN variable has switched on and off about 50 times. It is not guaranteed to be the opposite of the state it was when you pushed the key.
Cas... how does the buffer state help? Can I detect in the buffer the key being pushed, followed by it being released?