KeyCode.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. KeyCode by Justin Gilman
  3. Add this file at the top of any project that interacts
  4. with keyCode for a convenient way to reference the ASCII values.
  5. MIT License
  6. */
  7. const KeyCode = {
  8. Backspace: 8,
  9. Tab: 9,
  10. Enter: 13,
  11. Shift: 16,
  12. Ctrl: 17,
  13. Alt: 18,
  14. Pause: 19,
  15. CapsLock: 20,
  16. Esc: 27,
  17. Space: 32,
  18. PageUp: 33,
  19. PageDown: 34,
  20. End: 35,
  21. Home: 36,
  22. Left: 37,
  23. Up: 38,
  24. Right: 39,
  25. Down: 40,
  26. Insert: 45,
  27. Del: 46,
  28. NUM_0: 48,
  29. NUM_1: 49,
  30. NUM_2: 50,
  31. NUM_3: 51,
  32. NUM_4: 52,
  33. NUM_5: 53,
  34. NUM_6: 54,
  35. NUM_7: 55,
  36. NUM_8: 56,
  37. NUM_9: 57,
  38. A: 65,
  39. B: 66,
  40. C: 67,
  41. D: 68,
  42. E: 69,
  43. F: 70,
  44. G: 71,
  45. H: 72,
  46. I: 73,
  47. J: 74,
  48. K: 75,
  49. L: 76,
  50. M: 77,
  51. N: 78,
  52. O: 79,
  53. P: 80,
  54. Q: 81,
  55. R: 82,
  56. S: 83,
  57. T: 84,
  58. U: 85,
  59. V: 86,
  60. W: 87,
  61. X: 88,
  62. Y: 89,
  63. Z: 90,
  64. LeftMeta: 91,
  65. RightMeta: 92,
  66. Select: 93,
  67. NUMPAD_0: 96,
  68. NUMPAD_1: 97,
  69. NUMPAD_2: 98,
  70. NUMPAD_3: 99,
  71. NUMPAD_4: 100,
  72. NUMPAD_5: 101,
  73. NUMPAD_6: 102,
  74. NUMPAD_7: 103,
  75. NUMPAD_8: 104,
  76. NUMPAD_9: 105,
  77. Asterisk: 106,
  78. Plus: 107,
  79. Minus: 109,
  80. Decimal: 110,
  81. Divide: 111,
  82. F1: 112,
  83. F2: 113,
  84. F3: 114,
  85. F4: 115,
  86. F5: 116,
  87. F6: 117,
  88. F7: 118,
  89. F8: 119,
  90. F9: 120,
  91. F10: 121,
  92. F11: 122,
  93. F12: 123,
  94. NumLock: 144,
  95. ScrollLock: 145,
  96. Semicolon: 186,
  97. Equal: 187,
  98. Comma: 188,
  99. Dash: 189,
  100. Period: 190,
  101. Slash: 191,
  102. Backtick: 192,
  103. LeftBracket: 219,
  104. Backslash: 220,
  105. RightBracket: 221,
  106. Apostrophe: 222,
  107. };