Check here for the archived link originally used in this answer.
From that link:
In theory, the
onKeyDown
andonKeyUp
events represent keys being pressed or released, while theonKeyPress
event represents a character being typed. The implementation of the theory is not same in all browsers.