Debugging with Firebug in Firefox 8.0.1, I attach a keypress
event handler to an editable div. Every key press shows correctly in the console except the arrow keys, for which e.which
in the console is showing up as 0.
How can I get the keycodes for the up and down arrow keys?
It seems that you can't use keypress
for the arrow keys, only keyup
and keydown
: