Skip to content

Instantly share code, notes, and snippets.

@MaxySpark
Last active November 23, 2016 21:09
Show Gist options
  • Save MaxySpark/e0f43d76478b62ea205637b1ec39988a to your computer and use it in GitHub Desktop.
Save MaxySpark/e0f43d76478b62ea205637b1ec39988a to your computer and use it in GitHub Desktop.
Keyboard's Key Code For Javascript
//LETTERS
var keyA = 65;
var keyB = 66;
var keyC = 67;
var keyD = 68;
var keyE = 69;
var keyF = 70;
var keyG = 71;
var keyH = 72;
var keyI = 73;
var keyJ = 74;
var keyK = 75;
var keyL = 76;
var keyM = 77;
var keyN = 78;
var keyO = 79;
var keyP = 80;
var keyQ = 81;
var keyR = 82;
var keyS = 83;
var keyT = 84;
var keyU = 85;
var keyV = 86;
var keyW = 87;
var keyX = 88;
var keyY = 89;
var keyZ = 90;
//NUMBERS
var key0 = 48;
var key1 = 49;
var key2 = 50;
var key3 = 51;
var key4 = 52;
var key5 = 53;
var key6 = 54;
var key7 = 55;
var key8 = 56;
var key9 = 57;
//FUNCTION KEY
var keyF1 = 112;
var keyF2 = 113;
var keyF3 = 114;
var keyF4 = 115;
var keyF5 = 116;
var keyF6 = 117;
var keyF7 = 118;
var keyF8 = 119;
var keyF9 = 120;
var keyF10 = 121;
var keyF11 = 122;
var keyF12 = 123;
//NUMPAD NUMBERS
var keyNumpad0 = 96;
var keyNumpad1 = 97;
var keyNumpad2 = 98;
var keyNumpad3 = 99;
var keyNumpad4 = 100;
var keyNumpad5 = 101;
var keyNumpad6 = 102;
var keyNumpad7 = 103;
var keyNumpad8 = 104;
var keyNumpad9 = 105;
//KEY SYMBOL
var keyMultiply = 106;
var keyAdd = 107;
var keySubtract = 109;
var keyDecimalPoint = 110;
var keyDivide = 111;
//Other Functional Key
var keyBackSpace = 8;
var keyTab = 9;
var keyEnter = 13;
var keyShift = 16;
var keyCtrl = 17;
var keyAlt = 18;
var keyPause = 19;
var keyBreak = 19;
var keyCapsLock = 20;
var keyEscape = 27;
var keyPageUp = 33;
var keyPageDown = 34;
var keyEnd = 35;
var keyHome = 36;
//Arrow Keys
var keyLeftArrow = 37;
var keyUpArrow = 38;
var keyRightArrow = 39;
var keyDownArrow = 40;
//ISymbols and Other keys
var keyInsert = 45;
var keyDelete = 46;
var keyLeftWindow = 91;
var keyRightWindow = 92;
var keySelect = 93;
var keyNumLock = 144;
var keyScrollLock = 145;
var keySemiColon = 186;
var keyEqualSign = 187;
var keyComma = 188;
var keyDash = 189;
var keyPeriod = 190;
var keyForwardSlash = 191;
var keyGraveAccent = 192;
var keyOpenBracket = 219;
var keyBackSlash = 220;
var keyCloseBracket = 221;
var keySingleQuote = 222;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment