Created
October 18, 2025 20:10
-
-
Save jepler/674a841d690b91837f8d77cd7312b9af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | USB | Set 1 | X(Set 1) | Set 2 | X(Set 2) | Set 3 | X(Set 3) | keycap | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 53 | 29 | 39 | 0e | 29 | 0e | 29 | ` ~ | |
| 2 | 30 | 2 | 41 | 16 | 2 | 16 | 2 | 1 ! | |
| 3 | 31 | 3 | 3f | 1e | 3 | 1e | 3 | 2 @ | |
| 4 | 32 | 4 | 3d | 26 | 4 | 26 | 4 | 3 # | |
| 5 | 33 | 5 | 3b | 25 | 5 | 25 | 5 | 4 $ | |
| 6 | 34 | 6 | 3c | 2e | 6 | 2e | 6 | 5 % E | |
| 7 | 35 | 7 | 58 | 36 | 7 | 36 | 7 | 6 ^ | |
| 8 | 36 | 8 | 64 | 3d | 8 | 3d | 8 | 7 & | |
| 9 | 37 | 9 | 44 | 3e | 9 | 3e | 9 | 8 * | |
| 10 | 38 | 0a | 42 | 46 | 0a | 46 | 0a | 9 ( | |
| 11 | 39 | 0b | 40 | 45 | 0b | 45 | 0b | 0 ) | |
| 12 | 45 | 0c | 3e | 4e | 0c | 4e | 0c | - _ | |
| 13 | 46 | 0d | 0f | 55 | 0d | 55 | 0d | = + | |
| 15 | 42 | 0e | 29 | 66 | 0e | 66 | 0e | Backspace | |
| 16 | 43 | 0f | 59 | 0d | 0f | 0d | 0f | Tab | |
| 17 | 20 | 10 | 65 | 15 | 10 | 15 | 10 | Q | |
| 18 | 26 | 11 | 38 | 1d | 11 | 1d | 11 | W | |
| 19 | 8 | 12 | 2a | 24 | 12 | 24 | 12 | E | |
| 20 | 21 | 13 | 70 | 2d | 13 | 2d | 13 | R | |
| 21 | 23 | 14 | 1d | 2c | 14 | 2c | 14 | T | |
| 22 | 28 | 15 | 10 | 35 | 15 | 35 | 15 | Y | |
| 23 | 24 | 16 | 2 | 3c | 16 | 3c | 16 | U | |
| 24 | 12 | 17 | 5a | 43 | 17 | 43 | 17 | I | |
| 25 | 18 | 18 | 66 | 44 | 18 | 44 | 18 | O | |
| 26 | 19 | 19 | 71 | 4d | 19 | 4d | 19 | P | |
| 27 | 47 | 1a | 2c | 54 | 1a | 54 | 1a | [ { | |
| 28 | 48 | 1b | 1f | 5b | 1b | 5b | 1b | ] } | |
| 29 | 49 | 2b | 21 | 5d | 2b | 5c | 75 | \ | | |
| 30 | 57 | 3a | 32 | 58 | 3a | 14 | 1d | CapsLock | |
| 31 | 4 | 1e | 3 | 1c | 1e | 1c | 1e | A | |
| 32 | 22 | 1f | 5b | 1b | 1f | 1b | 1f | S | |
| 33 | 7 | 20 | 67 | 23 | 20 | 23 | 20 | D | |
| 34 | 9 | 21 | 2e | 2b | 21 | 2b | 21 | F | |
| 35 | 10 | 22 | 2d | 34 | 22 | 34 | 22 | G | |
| 36 | 11 | 23 | 20 | 33 | 23 | 33 | 23 | H | |
| 37 | 13 | 24 | 12 | 3b | 24 | 3b | 24 | J | |
| 38 | 14 | 25 | 5 | 42 | 25 | 42 | 25 | K | |
| 39 | 15 | 26 | 4 | 4b | 26 | 4b | 26 | L | |
| 40 | 51 | 27 | 5c | 4c | 27 | 4c | 27 | ; : | |
| 41 | 52 | 28 | 68 | 52 | 28 | 52 | 28 | ' " | |
| 42 | 50 | 0 | ff | 0 | ff | 0 | ff | non-US-1 | |
| 43 | 40 | 1c | 1e | 5a | 1c | 5a | 1c | Enter | |
| 44 | 225 | 2a | 2f | 12 | 2a | 12 | 2a | LShift | |
| 46 | 29 | 2c | 14 | 1a | 2c | 1a | 2c | Z | |
| 47 | 27 | 2d | 13 | 22 | 2d | 22 | 2d | X | |
| 48 | 6 | 2e | 6 | 21 | 2e | 21 | 2e | C | |
| 49 | 25 | 2f | 5d | 2a | 2f | 2a | 2f | V | |
| 50 | 5 | 30 | 69 | 32 | 30 | 32 | 30 | B | |
| 51 | 17 | 31 | 31 | 31 | 31 | 31 | 31 | N | |
| 52 | 16 | 32 | 30 | 3a | 32 | 3a | 32 | M | |
| 53 | 54 | 33 | 23 | 41 | 33 | 41 | 33 | , < | |
| 54 | 55 | 34 | 22 | 49 | 34 | 49 | 34 | . > | |
| 55 | 56 | 35 | 15 | 4a | 35 | 4a | 35 | / ? | |
| 57 | 229 | 36 | 7 | 59 | 36 | 59 | 36 | RShift | |
| 58 | 224 | 1d | 11 | 14 | 1d | 11 | 38 | LCtrl | |
| 60 | 226 | 38 | 6a | 11 | 38 | 19 | 71 | LAlt | |
| 61 | 44 | 39 | 72 | 29 | 39 | 29 | 39 | space | |
| 62 | 230 | e0-38 | e0-6a | e0-11 | e0-38 | 39 | 72 | RAlt | |
| 64 | 228 | e0-1d | e0-11 | e0-14 | e0-1d | 58 | 3a | RCtrl | |
| 75 | 73 | e0-52 | e0-28 | e0-70 | e0-52 | 67 | 7b | Insert | |
| 76 | 76 | e0-53 | e0-74 | e0-71 | e0-53 | 64 | 79 | Delete | |
| 80 | 74 | e0-47 | e0-60 | e0-6c | e0-47 | 6e | 7f | Home | |
| 81 | 77 | e0-4f | e0-61 | e0-69 | e0-4f | 65 | 7a | End | |
| 85 | 75 | e0-49 | e0-34 | e0-7d | e0-49 | 6f | 6f | PgUp | |
| 86 | 78 | e0-51 | e0-73 | e0-7a | e0-51 | 6d | 7e | PgDn | |
| 79 | 80 | e0-4b | e0-26 | e0-6b | e0-4b | 61 | 56 | Left | |
| 83 | 82 | e0-48 | e0-6c | e0-75 | e0-48 | 63 | 78 | Up | |
| 84 | 81 | e0-50 | e0-6d | e0-72 | e0-50 | 60 | 55 | Down | |
| 89 | 79 | e0-4d | e0-19 | e0-74 | e0-4d | 6a | 7d | Right | |
| 90 | 83 | 45 | 0b | 77 | 45 | 76 | 1 | NumLock | |
| 91 | 95 | 47 | 60 | 6c | 47 | 6c | 47 | KP-7 / Home | |
| 92 | 92 | 4b | 26 | 6b | 4b | 6b | 4b | KP-4 / Left | |
| 93 | 89 | 4f | 61 | 69 | 4f | 69 | 4f | KP-1 / End | |
| 95 | 84 | e0-35 | e0-15 | e0-4a | e0-35 | 77 | 45 | KP-/ | |
| 96 | 96 | 48 | 6c | 75 | 48 | 75 | 48 | KP-8 / Up | |
| 97 | 93 | 4c | 27 | 73 | 4c | 73 | 4c | KP-5 | |
| 98 | 90 | 50 | 6d | 72 | 50 | 72 | 50 | KP-2 / Down | |
| 99 | 98 | 52 | 28 | 70 | 52 | 70 | 52 | KP-0 / Ins | |
| 100 | 85 | 37 | 5e | 7c | 37 | 7e | 46 | KP-* | |
| 101 | 97 | 49 | 34 | 7d | 49 | 7d | 49 | KP-9 / PgUp | |
| 102 | 94 | 4d | 19 | 74 | 4d | 74 | 4d | KP-6 / Right | |
| 103 | 91 | 51 | 73 | 7a | 51 | 7a | 51 | KP-3 / PgDn | |
| 104 | 99 | 53 | 74 | 71 | 53 | 71 | 53 | KP-. / Del | |
| 105 | 86 | 4a | 35 | 7b | 4a | 84 | 54 | KP-- | |
| 106 | 87 | 4e | 0c | 79 | 4e | 7c | 37 | KP-+ | |
| 108 | 88 | e0-1c | e0-1e | e0-5a | e0-1c | 79 | 4e | KP-Enter | |
| 110 | 41 | 1 | 43 | 76 | 1 | 8 | 64 | Esc | |
| 112 | 58 | 3b | 24 | 5 | 3b | 7 | 58 | F1 | |
| 113 | 59 | 3c | 16 | 6 | 3c | 0f | 59 | F2 | |
| 114 | 60 | 3d | 8 | 4 | 3d | 17 | 5a | F3 | |
| 115 | 61 | 3e | 9 | 0c | 3e | 1f | 5b | F4 | |
| 116 | 62 | 3f | 5f | 3 | 3f | 27 | 5c | F5 | |
| 117 | 63 | 40 | 6b | 0b | 40 | 2f | 5d | F6 | |
| 118 | 64 | 41 | 33 | 83 | 41 | 37 | 5e | F7 | |
| 119 | 65 | 42 | 25 | 0a | 42 | 3f | 5f | F8 | |
| 120 | 66 | 43 | 17 | 1 | 43 | 47 | 60 | F9 | |
| 121 | 67 | 44 | 18 | 9 | 44 | 4f | 61 | F10 | |
| 122 | 68 | 57 | 6e | 78 | 57 | 56 | 62 | F11 | |
| 123 | 69 | 58 | 3a | 7 | 58 | 5e | 63 | F12 | |
| 124 | 70 | e0-37 | e0-5e | e0-7c | e0-37 | 57 | 6e | PrtScr | |
| 0 | 154 | 54 | 1a | 84 | 54 | 57 | 6e | Alt+SysRq | |
| 125 | 71 | 46 | 0a | 7e | 46 | 5f | 76 | ScrollLock | |
| 126 | 72 | e1-1d-45 | e1-11-0b | e1-14-77 | e1-1d-45 | 62 | 77 | Pause | |
| 0 | 0 | e0-46 | e0-0a | e0-7e | e0-46 | 62 | 77 | Ctrl+Break | |
| 0 | 227 | e0-5b | e0-1b | e0-1f | e0-5b | 8b | 8b | LWin (USB: LGUI) | |
| 0 | 231 | e0-5c | e0-75 | e0-27 | e0-5c | 8c | 8c | RWin (USB: RGUI) | |
| 0 | 0 | e0-5d | e0-2b | e0-2f | e0-5d | 8d | 8d | Menu | |
| 0 | 0 | e0-5f | e0-76 | e0-3f | e0-5f | 7f | 54 | Sleep | |
| 0 | 0 | e0-5e | e0-63 | e0-37 | e0-5e | 0 | ff | Power | |
| 0 | 0 | e0-63 | e0-78 | e0-5e | e0-63 | 0 | ff | Wake |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| with open("keymaps.csv") as f: | |
| rows = [[el.strip() for el in row] for row in csv.reader(f)] | |
| header = rows[0] | |
| del rows[0] | |
| assert header[1] == "USB" | |
| assert header[2] == "Set 1" | |
| assert header[-1] == "keycap" | |
| dq = "\"" | |
| def tohexstr(dashed): | |
| hexes = [int(x, 16) for x in dashed.split("-")] | |
| s1 = dq + "".join(f"\\x{x:02x}" for x in hexes) + dq | |
| hexes[-1] |= 0x80 | |
| s2 = dq + "".join(f"\\x{x:02x}" for x in hexes) + dq | |
| return f"{{ {s1:<16}, {s2:<16} }}" | |
| print("typedef struct { const char *press, const char *release } usb_to_xt;") | |
| print("static const usb_to_xt conversion[] = {") | |
| for row in rows: | |
| u = int(row[1]) | |
| if u == 0: continue | |
| x = tohexstr(row[2]) | |
| c = row[-1] | |
| if c == "Pause": | |
| x = '{ "\\xe1\\x1d\\x45\\xe1\\x9d\\xc5", "" }' | |
| print(f" [{u:3d}] = {x}, // {c}") | |
| print("};") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment