keyPress
does not include arrow keys - fiddle confirmation: https://jsfiddle.net/12a25f46/
keyPress
event.which
returns the ASCII character code that the key generates (eg Shift+A=65) - which makes no sense for arrow keys as they don't generate a character. So arrow keys are not included in keyPress.
keyUp
/ keyDown
event.which
shows the keyCode of the key pressed and will include arrows and whether shift(etc) was pressed.
So checking just keyPress
will allow you to check for numbers and % and also allow the cursor to be moved via the arrow keys.
Separately checking for keyUp
(or keyDown
) will allow you to check any key, but it will not use the same numbers (eg % is 53+shift, not 37)
So there's no conflict.
Update: according to this question (which is somewhat similar...) this might be an issue in IE10. Fiddle above tested in chrome and IE11, not IE10.
Another valid answer the indicates keypress
may be working incorrectly in some browsers.