Skip to content

Instantly share code, notes, and snippets.

@AlexeyGy
Created September 18, 2020 12:51
Show Gist options
  • Save AlexeyGy/c047b457ed92f3e877966e1042dd225e to your computer and use it in GitHub Desktop.
Save AlexeyGy/c047b457ed92f3e877966e1042dd225e to your computer and use it in GitHub Desktop.
package main
// Keycodes maps keys to their respective virtual key code from https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
var Keycodes = map[string]uint16{
" ": 0x20,
"-": 0xBD,
"0": 0x30,
"1": 0x31,
"2": 0x32,
"3": 0x33,
"4": 0x34,
"5": 0x35,
"6": 0x36,
"7": 0x37,
"8": 0x38,
"9": 0x39,
"A": 0x41,
"B": 0x42,
"C": 0x43,
"D": 0x44,
"E": 0x45,
"F": 0x46,
"G": 0x47,
"H": 0x48,
"I": 0x49,
"J": 0x4a,
"K": 0x4b,
"L": 0x4c,
"M": 0x4d,
"N": 0x4e,
"O": 0x4f,
"P": 0x50,
"Q": 0x51,
"R": 0x52,
"S": 0x53,
"T": 0x54,
"U": 0x55,
"V": 0x56,
"W": 0x57,
"X": 0x58,
"Y": 0x59,
"Z": 0x5a,
"CTRL": 0x011,
"ALT": 0x012,
",": 0xBC,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment