Prevent keyboard input from spamming.