a key packet, as returned by the kernel, is a 32-bit value. the top
13 bits are currently reserved. the next 11 bits are flags as follows:
  0x040000: break (as opposed to make)
  0x020000: num lock is on
  0x010000: caps lock is on
  0x008000: right windows
  0x004000: left windows
  0x002000: right alt
  0x001000: left alt
  0x000800: right ctrl
  0x000400: left ctrl
  0x000200: right shift
  0x000100: left shift
the bottom 8 bits represent the key. for us qwerty, they are:
  0x00: reserved   | 0x40: reserved    | 0x80: reserved   | 0xc0: reserved
  0x01: f9         | 0x41: , / <       | 0x81: reserved   | 0xc1: reserved
  0x02: reserved   | 0x42: k / K       | 0x82: reserved   | 0xc2: reserved
  0x03: f5         | 0x43: i / I       | 0x83: reserved   | 0xc3: reserved
  0x04: f3         | 0x44: o / O       | 0x84: reserved   | 0xc4: reserved
  0x05: f1         | 0x45: 0 / )       | 0x85: reserved   | 0xc5: reserved
  0x06: f2         | 0x46: 9 / (       | 0x86: reserved   | 0xc6: reserved
  0x07: f12        | 0x47: reserved    | 0x87: f7         | 0xc7: reserved
  0x08: reserved   | 0x48: reserved    | 0x88: reserved   | 0xc8: reserved
  0x09: f10        | 0x49: . / >       | 0x89: reserved   | 0xc9: reserved
  0x0a: f8         | 0x4a: / / ?       | 0x8a: reserved   | 0xca: numpad /
  0x0b: f6         | 0x4b: l / L       | 0x8b: reserved   | 0xcb: reserved
  0x0c: f4         | 0x4c: ; / :       | 0x8c: reserved   | 0xcc: reserved
  0x0d: tab        | 0x4d: p / P       | 0x8d: reserved   | 0xcd: reserved
  0x0e: ` / ~      | 0x4e: - / _       | 0x8e: reserved   | 0xce: reserved
  0x0f: reserved   | 0x4f: reserved    | 0x8f: reserved   | 0xcf: reserved
  0x10: reserved   | 0x50: reserved    | 0x90: reserved   | 0xd0: reserved
  0x11: left alt   | 0x51: reserved    | 0x91: right alt  | 0xd1: reserved
  0x12: left shift | 0x52: ' / "       | 0x92:            | 0xd2: reserved
  0x13: reserved   | 0x53: reserved    | 0x93: reserved   | 0xd3: reserved
  0x14: left ctrl  | 0x54: [ / {       | 0x94: right ctrl | 0xd4: reserved
  0x15: q / Q      | 0x55: = / +       | 0x95: reserved   | 0xd5: reserved
  0x16: 1 / !      | 0x56: reserved    | 0x96: reserved   | 0xd6: reserved
  0x17: reserved   | 0x57: reserved    | 0x97: reserved   | 0xd7: reserved
  0x18: reserved   | 0x58: caps lock   | 0x98: reserved   | 0xd8: reserved
  0x19: reserved   | 0x59: right shift | 0x99: reserved   | 0xd9: reserved
  0x1a: z / Z      | 0x5a: enter       | 0x9a: reserved   | 0xda: numpad enter
  0x1b: s / S      | 0x5b: ] / }       | 0x9b: reserved   | 0xdb: reserved
  0x1c: a / A      | 0x5c: reserved    | 0x9c: reserved   | 0xdc: reserved
  0x1d: w / W      | 0x5d: \ / |       | 0x9d: reserved   | 0xdd: reserved
  0x1e: 2 / @      | 0x5e: reserved    | 0x9e: reserved   | 0xde: reserved
  0x1f: reserved   | 0x5f: reserved    | 0x9f: left win   | 0xdf: reserved
  0x20: reserved   | 0x60: reserved    | 0xa0: reserved   | 0xe0: print screen
  0x21: c / C      | 0x61: reserved    | 0xa1: reserved   | 0xe1: pause
  0x22: x / X      | 0x62: reserved    | 0xa2: reserved   | 0xe2: reserved
  0x23: d / D      | 0x63: reserved    | 0xa3: reserved   | 0xe3: reserved
  0x24: e / E      | 0x64: reserved    | 0xa4: reserved   | 0xe4: reserved
  0x25: 4 / $      | 0x65: reserved    | 0xa5: reserved   | 0xe5: reserved
  0x26: 3 / #      | 0x66: backspace   | 0xa6: reserved   | 0xe6: reserved
  0x27: reserved   | 0x67: reserved    | 0xa7: right win  | 0xe7: reserved
  0x28: reserved   | 0x68: reserved    | 0xa8: reserved   | 0xe8: reserved
  0x29: space      | 0x69: numpad 1    | 0xa9: reserved   | 0xe9: end
  0x2a: v / V      | 0x6a: reserved    | 0xaa: reserved   | 0xea: reserved
  0x2b: f / F      | 0x6b: numpad 4    | 0xab: reserved   | 0xeb: cursor left
  0x2c: t / T      | 0x6c: numpad 7    | 0xac: reserved   | 0xec: home
  0x2d: r / R      | 0x6d: reserved    | 0xad: reserved   | 0xed: reserved
  0x2e: 5 / %      | 0x6e: reserved    | 0xae: reserved   | 0xee: reserved
  0x2f: reserved   | 0x6f: reserved    | 0xaf: menu       | 0xef: reserved
  0x30: reserved   | 0x70: numpad 0    | 0xb0: reserved   | 0xf0: insert
  0x31: n / N      | 0x71: numpad .    | 0xb1: reserved   | 0xf1: delete
  0x32: b / B      | 0x72: numpad 2    | 0xb2: reserved   | 0xf2: cursor down
  0x33: h / H      | 0x73: numpad 5    | 0xb3: reserved   | 0xf3: reserved
  0x34: g / G      | 0x74: numpad 6    | 0xb4: reserved   | 0xf4: cursor right
  0x35: y / Y      | 0x75: numpad 8    | 0xb5: reserved   | 0xf5: cursor up
  0x36: 6 / ^      | 0x76: escape      | 0xb6: reserved   | 0xf6: reserved
  0x37: reserved   | 0x77: num lock    | 0xb7: reserved   | 0xf7: reserved
  0x38: reserved   | 0x78: f11         | 0xb8: reserved   | 0xf8: reserved
  0x39: reserved   | 0x79: numpad +    | 0xb9: reserved   | 0xf9: reserved
  0x3a: m / M      | 0x7a: numpad 3    | 0xba: reserved   | 0xfa: page down
  0x3b: j / J      | 0x7b: numpad -    | 0xbb: reserved   | 0xfb: reserved
  0x3c: u / U      | 0x7c: numpad *    | 0xbc: reserved   | 0xfc: reserved
  0x3d: 7 / &      | 0x7d: numpad 9    | 0xbd: reserved   | 0xfd: page up
  0x3e: 8 / *      | 0x7e: scroll lock | 0xbe: reserved   | 0xfe: reserved
  0x3f: reserved   | 0x7f: reserved    | 0xbf: reserved   | 0xff: reserved
