Keyboard Events
Output Text:
keydown event.which:
keyup      event.which:
keypress  event.which:
focus     

Keydown: triggers on when you press a key and it returns the scan-code from the keyboard. (A and a both return 65)

Keypress: triggers after keydown, and it returns the charcode.
(A returns 65 and a returns 97)
But this only works reliably for character codes (not Esc, Home, End, Arrows etc. and the results are browser dependent).

Article: Detecting Keys - [quirksmode]