while(Keyboard.next()){
if(Keyboard.getEventKey() == Keyboard.KEY_W){
if(Keyboard.getEventKeyState()){
setMoving(true,0);
}
//...etc for A, S, D
This is the code that I use that is supposed to register the key press a single time, and then not anymore. It prevents the action from repeating even if your keys are held down. For an action like movement, however, repeated action from holding down a button is necessary. I have tried screwing around with the code(changing if to while, but that always freezes it up, and removing some of the loops) but none of it is working. What is the code that one needs to allow holding down keys yielding a repeated action?