Skip to content

Instantly share code, notes, and snippets.

@0xWOF
Created February 19, 2019 02:28
Show Gist options
  • Save 0xWOF/bafc61993bfc0db6527201e50a8ec10f to your computer and use it in GitHub Desktop.
Save 0xWOF/bafc61993bfc0db6527201e50a8ec10f to your computer and use it in GitHub Desktop.
MacOS US keyboard character to keycode
char keycode_array[47][3][1] = {
{'`', '~', 50},
{'1', '!', 18},
{'2', '@', 19},
{'3', '#', 20},
{'4', '$', 21},
{'5', '%', 23},
{'6', '^', 22},
{'7', '&', 26},
{'8', '*', 28},
{'9', '(', 25},
{'0', ')', 29},
{'-', '_', 27},
{'=', '+', 24},
{'q', 'Q', 12},
{'w', 'W', 13},
{'e', 'E', 14},
{'r', 'R', 15},
{'t', 'T', 17},
{'y', 'Y', 16},
{'u', 'U', 32},
{'i', 'I', 34},
{'o', 'O', 31},
{'p', 'P', 35},
{'[', '{', 33},
{']', '}', 30},
{'\\', '|', 42},
{'a', 'A', 0},
{'s', 'S', 1},
{'d', 'D', 2},
{'f', 'F', 3},
{'g', 'G', 5},
{'h', 'H', 4},
{'j', 'J', 38},
{'k', 'K', 40},
{'l', 'L', 37},
{';', ':', 41},
{'\'', '"', 39},
{'z', 'Z', 6},
{'x', 'X', 7},
{'c', 'C', 8},
{'v', 'V', 9},
{'b', 'B', 11},
{'n', 'N', 45},
{'m', 'M', 46},
{',', '<', 43},
{'.', '>', 47},
{'/', '?', 44}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment