Javascript Keycode for a: 65 or 97? -


i'm working javascript (on macbook pro osx 10.11.x, not sure if matters) using chrome browser. im using function:

window.onkeypress = function(e) {     var key = e.keycode ? e.keycode : e.which;     console.log("keypressed = " + key); } 

when press 'a' key on keyboard, logs 97, not correspond other keycode list find on internet, states 'a' 65.

this same other keys well, example, 's' me 115, else states 's' 83.

is there dependency i'm missing? if fire event assuming == 95, work on other browsers?

thanks.

so found capital a indeed, 65.

a lowercase a 97

please see chart:

enter image description here

chart original location: http://www.asciitable.com/


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -