Are you using a wireless keyboard? When I used a wireless Microsoft keyboard, sometimes the keyUp event got lost in transit. Which was a real pain when it was the Backspace key that I'd tapped a moment before.
Don't use wireless keyboards. Apart from anything else, you're broadcasting your username and password through the walls to your next door neighbours / skript-kiddies whenever you log into a website, Windows, etc. etc. etc.