Closed vibra closed 9 years ago
Keycodes are about the physical key you pressed on the keyboard. The numpad keys are different keys from the other numbered keys, so they produce a different keycode.
I recommend this article about all the quircks in handling keyboard events in our browsers: http://unixpapa.com/js/key.html
49 is the keycode for the 1 above the letter keys and 97 is the keycode for the number pad 1. The "a" key is keycode 65. Perhaps you have a weird browser/OS combo that is reporting unexpected keycodes?
Hi, I am trying to use Keypress and I would like to display in clear the value of the key. I tested this: alert (key + ' / ' + keypress._keycode_dictionary[key]); When I press a 'a', I am expecting a window displaying 97 / "a" but I have 97 / "num1" And if I press a 1 in the numpad, I have 49 / "1" but I was expecting 49 / "num1" !
In fact I realize that I cannot use the key value to access the _keycode_dictionary table. So is there a mean to do what I want ?