1

Typing # gives inconsistent keyCodes on Android:

Chrome on Ubuntu 14.10:  "#" keyCode = 222
Chrome on Android 4.4.4: "#" keyCode = 51

Why is that??

onkeyup=alert(event.keyCode);
ajo
  • 1,045
  • 4
  • 15
  • 30

1 Answers1

1

The keycode values are not all standardized across browsers. There's a table of the differences at javascripter.net, where they say:

No, unfortunately, not all key codes are standardized. For example, the minus key has different key codes in different browsers.

Other examples they cite of keycodes commonly different between browsers are ;:, =+, and -_.

Sam Hanley
  • 4,707
  • 7
  • 35
  • 63