Skip to content

Instantly share code, notes, and snippets.

@nnnewb
Created January 5, 2019 05:08
Show Gist options
  • Save nnnewb/6e65ab6c280d0f8c25b8ef9a30d949d3 to your computer and use it in GitHub Desktop.
Save nnnewb/6e65ab6c280d0f8c25b8ef9a30d949d3 to your computer and use it in GitHub Desktop.
enum Keycode by typescript
export enum Keycode {
None = -1,
// none = 0,1,2,3,4,5,6,7
BackSpace = 8,
Tab = 9,
// none = 10,11,12
Enter = 13,
// none = 14,15
Shift = 16,
Ctrl = 17,
Alt = 18,
PauseBreak = 19,
CapsLock = 20,
// none = 21,22,23,24,25,26
Esc = 27,
// none = 28,29,30,31,32
PageUp = 33,
PageDown = 34,
End = 35,
Home = 36,
ArrowLeft = 37,
ArrowUp = 38,
ArrowRight = 39,
ArrowDown = 40,
// none = 41,42,43,44
Insert = 45,
Delete = 46,
// none= 47
KeyPad0 = 48,
KeyPad1 = 49,
KeyPad2 = 50,
KeyPad3 = 51,
KeyPad4 = 52,
KeyPad5 = 53,
KeyPad6 = 54,
KeyPad7 = 55,
KeyPad8 = 56,
KeyPad9 = 57,
// none = 58
semicolon = 59, // ;:
// none = 60
equals = 61, // =+
// none = 62,63,64
a = 65,
b = 66,
c = 67,
d = 68,
e = 69,
f = 70,
g = 71,
h = 72,
i = 73,
j = 74,
k = 75,
l = 76,
m = 77,
n = 78,
o = 79,
p = 80,
q = 81,
r = 82,
s = 83,
t = 84,
u = 85,
v = 86,
w = 87,
x = 88,
y = 89,
z = 90,
Windows = 91,
// none = 92
RightClick = 93,
// none = 94,95
NumPad0 = 96,
NumPad1 = 97,
NumPad2 = 98,
NumPad3 = 99,
NumPad4 = 100,
NumPad5 = 101,
NumPad6 = 102,
NumPad7 = 103,
NumPad8 = 104,
NumPad9 = 105,
NumPadStar = 106, // *
NumPadPlus = 107, // +
// none = 108,
NumPadMinus = 109, // -
NumPadDot = 110, // .
NumPadSlash = 111, // /
F1 = 112,
F2 = 113,
F3 = 114,
F4 = 115,
F5 = 116,
F6 = 117,
F7 = 118,
F8 = 119,
F9 = 120,
F10 = 121,
F11 = 122,
F12 = 123,
// none = 124,125,...,143
NumLock = 144,
ScrollLock = 145,
// none = 146,147,...,181
MyComputer = 182, // ???
MyCalculator = 183, // ???
// none = 184,185,...,187
Comma = 188, // ,<
// none = 189
Dot = 190, // .>
Slash = 191, // /?
BackQuote = 192, // `~
// none = 193,194,...,218
LeftSquareParen = 219, // {[
BackSlash = 220, // \|
RightSquareParen = 221, // ]}
Quote = 222 // '"
// none = 223,224,...,249
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment