1

Possible Duplicate:
FULL list of JavaScript keycodes

Where can I found the official reference of the key codes in javascript?

Google founds only gappy tables.

Especially I'm looking for the key code of double quote.

Community
  • 1
  • 1

3 Answers3

1

If you're testing for typed characters (as opposed to detecting non-printable keystrokes) then you do not need a look-up table. Use the keypress event and you can get the character code and hence typed character from the event in any major browser:

document.onkeypress = function(evt) {
    evt = evt || window.event;
    var charCode = (typeof evt.which == "number") ? evt.which : evt.keyCode;
    if (String.fromCharCode(charCode) == '"') {
        alert("Double quote typed");
    }
};
Tim Down
  • 318,141
  • 75
  • 454
  • 536
0

Personnally I use this list : http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes And this is kind of a reference for JS keyboard events : http://unixpapa.com/js/key.html

koopajah
  • 23,792
  • 9
  • 78
  • 104
0

Key code for doube quote is 34 222 (Mozzila, firefox, IE) similar question is already asked here: What are the JavaScript KeyCodes?

Community
  • 1
  • 1
Prashant Lakhlani
  • 5,758
  • 5
  • 25
  • 39