Fixing keypress handling.

Keypress often comes with keyCode=0. Then we need to map e.which
to a keyCode.