KeyboardEvent.KEY_UP - user presses a key and then you wait until they release it before your code accepts another input. Theoretically that should work.