From ea92d5ed7d6641e42698c8c648875c7ed28bcdb6 Mon Sep 17 00:00:00 2001 From: zvecr Date: Mon, 9 May 2022 23:51:43 +0100 Subject: [PATCH] Block out basic keycodes --- data/constants/keycodes_0.0.1.json | 1298 ++++++++++++++++++++++++++++ data/xap/xap_0.1.0.hjson | 4 + lib/python/qmk/cli/xap/xap.py | 14 +- 3 files changed, 1309 insertions(+), 7 deletions(-) create mode 100644 data/constants/keycodes_0.0.1.json diff --git a/data/constants/keycodes_0.0.1.json b/data/constants/keycodes_0.0.1.json new file mode 100644 index 0000000000..cd3c2876ed --- /dev/null +++ b/data/constants/keycodes_0.0.1.json @@ -0,0 +1,1298 @@ +{ + "groups": { + "basic": {} + }, + "ranges": { + "0x0000/0x00FF": {} + }, + "keycodes": { + "0x0000": { + "group": "basic", + "key": "KC_NO", + "label": "", + "aliases": [ + "XXXXXXX" + ] + }, + "0x0001": { + "group": "basic", + "key": "KC_TRANSPARENT", + "label": "", + "aliases": [ + "_______", + "KC_TRNS" + ] + }, + "0x0004": { + "group": "basic", + "key": "KC_A", + "label": "A" + }, + "0x0005": { + "group": "basic", + "key": "KC_B", + "label": "B" + }, + "0x0006": { + "group": "basic", + "key": "KC_C", + "label": "C" + }, + "0x0007": { + "group": "basic", + "key": "KC_D", + "label": "D" + }, + "0x0008": { + "group": "basic", + "key": "KC_E", + "label": "E" + }, + "0x0009": { + "group": "basic", + "key": "KC_F", + "label": "F" + }, + "0x000a": { + "group": "basic", + "key": "KC_G", + "label": "G" + }, + "0x000b": { + "group": "basic", + "key": "KC_H", + "label": "H" + }, + "0x000c": { + "group": "basic", + "key": "KC_I", + "label": "I" + }, + "0x000d": { + "group": "basic", + "key": "KC_J", + "label": "J" + }, + "0x000e": { + "group": "basic", + "key": "KC_K", + "label": "K" + }, + "0x000f": { + "group": "basic", + "key": "KC_L", + "label": "L" + }, + "0x0010": { + "group": "basic", + "key": "KC_M", + "label": "M" + }, + "0x0011": { + "group": "basic", + "key": "KC_N", + "label": "N" + }, + "0x0012": { + "group": "basic", + "key": "KC_O", + "label": "O" + }, + "0x0013": { + "group": "basic", + "key": "KC_P", + "label": "P" + }, + "0x0014": { + "group": "basic", + "key": "KC_Q", + "label": "Q" + }, + "0x0015": { + "group": "basic", + "key": "KC_R", + "label": "R" + }, + "0x0016": { + "group": "basic", + "key": "KC_S", + "label": "S" + }, + "0x0017": { + "group": "basic", + "key": "KC_T", + "label": "T" + }, + "0x0018": { + "group": "basic", + "key": "KC_U", + "label": "U" + }, + "0x0019": { + "group": "basic", + "key": "KC_V", + "label": "V" + }, + "0x001a": { + "group": "basic", + "key": "KC_W", + "label": "W" + }, + "0x001b": { + "group": "basic", + "key": "KC_X", + "label": "X" + }, + "0x001c": { + "group": "basic", + "key": "KC_Y", + "label": "Y" + }, + "0x001d": { + "group": "basic", + "key": "KC_Z", + "label": "Z" + }, + "0x001e": { + "group": "basic", + "key": "KC_1", + "label": "1" + }, + "0x001f": { + "group": "basic", + "key": "KC_2", + "label": "2" + }, + "0x0020": { + "group": "basic", + "key": "KC_3", + "label": "3" + }, + "0x0021": { + "group": "basic", + "key": "KC_4", + "label": "4" + }, + "0x0022": { + "group": "basic", + "key": "KC_5", + "label": "5" + }, + "0x0023": { + "group": "basic", + "key": "KC_6", + "label": "6" + }, + "0x0024": { + "group": "basic", + "key": "KC_7", + "label": "7" + }, + "0x0025": { + "group": "basic", + "key": "KC_8", + "label": "8" + }, + "0x0026": { + "group": "basic", + "key": "KC_9", + "label": "9" + }, + "0x0027": { + "group": "basic", + "key": "KC_0", + "label": "0" + }, + "0x0028": { + "group": "basic", + "key": "KC_ENTER", + "label": "0", + "aliases": [ + "KC_ENT" + ] + }, + "0x0029": { + "group": "basic", + "key": "KC_ESCAPE", + "label": "0", + "aliases": [ + "KC_ESC" + ] + }, + "0x002a": { + "group": "basic", + "key": "KC_BACKSPACE", + "label": "0", + "aliases": [ + "KC_BSPC" + ] + }, + "0x002b": { + "group": "basic", + "key": "KC_TAB", + "label": "Tab" + }, + "0x002c": { + "group": "basic", + "key": "KC_SPACE", + "label": "Spacebar", + "aliases": [ + "KC_SPC" + ] + }, + "0x002d": { + "group": "basic", + "key": "KC_MINUS", + "label": "-", + "aliases": [ + "KC_MINS" + ] + }, + "0x002e": { + "group": "basic", + "key": "KC_EQUAL", + "label": "=", + "aliases": [ + "KC_EQL" + ] + }, + "0x002f": { + "group": "basic", + "key": "KC_LEFT_BRACKET", + "label": "]", + "aliases": [ + "KC_LBRC" + ] + }, + "0x0030": { + "group": "basic", + "key": "KC_RIGHT_BRACKET", + "label": "[", + "aliases": [ + "KC_RBRC" + ] + }, + "0x0031": { + "group": "basic", + "key": "KC_BACKSLASH", + "label": "\\", + "aliases": [ + "KC_BSLS" + ] + }, + "0x0032": { + "group": "basic", + "key": "KC_NONUS_HASH", + "label": "#", + "aliases": [ + "KC_NUHS" + ] + }, + "0x0033": { + "group": "basic", + "key": "KC_SEMICOLON", + "label": ";", + "aliases": [ + "KC_SCLN" + ] + }, + "0x0034": { + "group": "basic", + "key": "KC_QUOTE", + "label": "'", + "aliases": [ + "KC_QUOT" + ] + }, + "0x0035": { + "group": "basic", + "key": "KC_GRAVE", + "label": "`", + "aliases": [ + "KC_GRV" + ] + }, + "0x0036": { + "group": "basic", + "key": "KC_COMMA", + "label": ",", + "aliases": [ + "KC_COMM" + ] + }, + "0x0037": { + "group": "basic", + "key": "KC_DOT", + "label": "." + }, + "0x0038": { + "group": "basic", + "key": "KC_SLASH", + "label": "/", + "aliases": [ + "KC_SLSH" + ] + }, + "0x0039": { + "group": "basic", + "key": "KC_CAPS_LOCK", + "label": "Caps Lock", + "aliases": [ + "KC_CAPS" + ] + }, + "0x003a": { + "group": "basic", + "key": "KC_F1", + "label": "F1" + }, + "0x003b": { + "group": "basic", + "key": "KC_F2", + "label": "F2" + }, + "0x003c": { + "group": "basic", + "key": "KC_F3", + "label": "F3" + }, + "0x003d": { + "group": "basic", + "key": "KC_F4", + "label": "F4" + }, + "0x003e": { + "group": "basic", + "key": "KC_F5", + "label": "F5" + }, + "0x003f": { + "group": "basic", + "key": "KC_F6", + "label": "F6" + }, + "0x0040": { + "group": "basic", + "key": "KC_F7", + "label": "F7" + }, + "0x0041": { + "group": "basic", + "key": "KC_F8", + "label": "F8" + }, + "0x0042": { + "group": "basic", + "key": "KC_F9", + "label": "F9" + }, + "0x0043": { + "group": "basic", + "key": "KC_F10", + "label": "F10" + }, + "0x0044": { + "group": "basic", + "key": "KC_F11", + "label": "F11" + }, + "0x0045": { + "group": "basic", + "key": "KC_F12", + "label": "F12" + }, + "0x0046": { + "group": "basic", + "key": "KC_PRINT_SCREEN", + "label": "Print Screen", + "aliases": [ + "KC_PSCR" + ] + }, + "0x0047": { + "group": "basic", + "key": "KC_SCROLL_LOCK", + "label": "Scroll Lock", + "aliases": [ + "KC_SCRL" + ] + }, + "0x0048": { + "group": "basic", + "key": "KC_PAUSE", + "label": "Pause", + "aliases": [ + "KC_PAUS", + "KC_BRK" + ] + }, + "0x0049": { + "group": "basic", + "key": "KC_INSERT", + "label": "Insert", + "aliases": [ + "KC_INS" + ] + }, + "0x004a": { + "group": "basic", + "key": "KC_HOME", + "label": "Home" + }, + "0x004b": { + "group": "basic", + "key": "KC_PAGE_UP", + "label": "Page Up", + "aliases": [ + "KC_PGUP" + ] + }, + "0x004c": { + "group": "basic", + "key": "KC_DELETE", + "label": "Delete", + "aliases": [ + "KC_DEL" + ] + }, + "0x004d": { + "group": "basic", + "key": "KC_END", + "label": "End" + }, + "0x004e": { + "group": "basic", + "key": "KC_PAGE_DOWN", + "label": "Page Down", + "aliases": [ + "KC_PGDN" + ] + }, + "0x004f": { + "group": "basic", + "key": "KC_RIGHT", + "label": "Right", + "aliases": [ + "KC_RGHT" + ] + }, + "0x0050": { + "group": "basic", + "key": "KC_LEFT", + "label": "Left" + }, + "0x0051": { + "group": "basic", + "key": "KC_DOWN", + "label": "Down" + }, + "0x0052": { + "group": "basic", + "key": "KC_Up", + "label": "Up" + }, + "0x0053": { + "group": "basic", + "key": "KC_NUM_LOCK", + "label": "Num Lock", + "aliases": [ + "KC_NUM" + ] + }, + "0x0054": { + "group": "basic", + "key": "KC_KP_SLASH", + "label": "/", + "aliases": [ + "KC_PSLS" + ] + }, + "0x0055": { + "group": "basic", + "key": "KC_KP_ASTERISK", + "label": "*", + "aliases": [ + "KC_PAST" + ] + }, + "0x0056": { + "group": "basic", + "key": "KC_KP_MINUS", + "label": "-", + "aliases": [ + "KC_PMNS" + ] + }, + "0x0057": { + "group": "basic", + "key": "KC_KP_PLUS", + "label": "+", + "aliases": [ + "KC_PPLS" + ] + }, + "0x0058": { + "group": "basic", + "key": "KC_KP_ENTER", + "label": "Enter", + "aliases": [ + "KC_PENT" + ] + }, + "0x0059": { + "group": "basic", + "key": "KC_KP_1", + "label": "1", + "aliases": [ + "KC_P1" + ] + }, + "0x005a": { + "group": "basic", + "key": "KC_KP_2", + "label": "2", + "aliases": [ + "KC_P2" + ] + }, + "0x005b": { + "group": "basic", + "key": "KC_KP_3", + "label": "3", + "aliases": [ + "KC_P3" + ] + }, + "0x005c": { + "group": "basic", + "key": "KC_KP_4", + "label": "4", + "aliases": [ + "KC_P4" + ] + }, + "0x005d": { + "group": "basic", + "key": "KC_KP_5", + "label": "5", + "aliases": [ + "KC_P5" + ] + }, + "0x005e": { + "group": "basic", + "key": "KC_KP_6", + "label": "6", + "aliases": [ + "KC_P6" + ] + }, + "0x005f": { + "group": "basic", + "key": "KC_KP_7", + "label": "7", + "aliases": [ + "KC_P7" + ] + }, + "0x0060": { + "group": "basic", + "key": "KC_KP_8", + "label": "8", + "aliases": [ + "KC_P8" + ] + }, + "0x0061": { + "group": "basic", + "key": "KC_KP_9", + "label": "9", + "aliases": [ + "KC_P9" + ] + }, + "0x0062": { + "group": "basic", + "key": "KC_KP_0", + "label": "0", + "aliases": [ + "KC_P0" + ] + }, + "0x0063": { + "group": "basic", + "key": "KC_KP_DOT", + "label": ".", + "aliases": [ + "KC_PDOT" + ] + }, + "0x0064": { + "group": "basic", + "key": "KC_NONUS_BACKSLASH", + "label": "\\", + "aliases": [ + "KC_NUBS" + ] + }, + "0x0065": { + "group": "basic", + "key": "KC_APPLICATION", + "label": "Application", + "aliases": [ + "KC_APP" + ] + }, + "0x0066": { + "group": "basic", + "key": "KC_KB_POWER", + "label": "Application" + }, + "0x0067": { + "group": "basic", + "key": "KC_KP_EQUAL", + "label": "=", + "aliases": [ + "KC_PEQL" + ] + }, + "0x0068": { + "group": "basic", + "key": "KC_F13", + "label": "F13" + }, + "0x0069": { + "group": "basic", + "key": "KC_F14", + "label": "F14" + }, + "0x006a": { + "group": "basic", + "key": "KC_F15", + "label": "F15" + }, + "0x006b": { + "group": "basic", + "key": "KC_F16", + "label": "F16" + }, + "0x006c": { + "group": "basic", + "key": "KC_F17", + "label": "F17" + }, + "0x006d": { + "group": "basic", + "key": "KC_F17", + "label": "F18" + }, + "0x006e": { + "group": "basic", + "key": "KC_F19", + "label": "F19" + }, + "0x006f": { + "group": "basic", + "key": "KC_F20", + "label": "F20" + }, + "0x0070": { + "group": "basic", + "key": "KC_F21", + "label": "F21" + }, + "0x0071": { + "group": "basic", + "key": "KC_F22", + "label": "F22" + }, + "0x0072": { + "group": "basic", + "key": "KC_F23", + "label": "F23" + }, + "0x0073": { + "group": "basic", + "key": "KC_F24", + "label": "F24" + }, + "0x0074": { + "group": "basic", + "key": "KC_EXECUTE", + "label": "Execute", + "aliases": [ + "KC_EXEC" + ] + }, + "0x0075": { + "group": "basic", + "key": "KC_HELP", + "label": "Help" + }, + "0x0076": { + "group": "basic", + "key": "KC_MENU", + "label": "Menu" + }, + "0x0077": { + "group": "basic", + "key": "KC_SELECT", + "label": "Select", + "aliases": [ + "KC_SLCT" + ] + }, + "0x0078": { + "group": "basic", + "key": "KC_STOP", + "label": "Stop" + }, + "0x0079": { + "group": "basic", + "key": "KC_AGAIN", + "label": "Again", + "aliases": [ + "KC_AGIN" + ] + }, + "0x007a": { + "group": "basic", + "key": "KC_UNDO", + "label": "Undo" + }, + "0x007b": { + "group": "basic", + "key": "KC_CUT", + "label": "Cut" + }, + "0x007c": { + "group": "basic", + "key": "KC_COPY", + "label": "Copy" + }, + "0x007d": { + "group": "basic", + "key": "KC_PASTE", + "label": "Paste", + "aliases": [ + "KC_PSTE" + ] + }, + "0x007e": { + "group": "basic", + "key": "KC_FIND", + "label": "Find" + }, + "0x007f": { + "group": "basic", + "key": "KC_KB_MUTE", + "label": "Mute" + }, + "0x0080": { + "group": "basic", + "key": "KC_KB_VOLUME_UP", + "label": "Volume Up" + }, + "0x0081": { + "group": "basic", + "key": "KC_KB_VOLUME_DOWN", + "label": "Volume Down" + }, + "0x0082": { + "group": "basic", + "key": "KC_LOCKING_CAPS_LOCK", + "label": "Caps Lock", + "aliases": [ + "KC_LCAP" + ] + }, + "0x0083": { + "group": "basic", + "key": "KC_LOCKING_NUM_LOCK", + "label": "Num Lock", + "aliases": [ + "KC_LSCR" + ] + }, + "0x0084": { + "group": "basic", + "key": "KC_LOCKING_SCROLL_LOCK", + "label": "Scroll Lock", + "aliases": [ + "KC_LCAP" + ] + }, + "0x0085": { + "group": "basic", + "key": "KC_KP_COMMA", + "label": ",", + "aliases": [ + "KC_PCMM" + ] + }, + "0x0086": { + "group": "basic", + "key": "KC_KP_EQUAL_AS400", + "label": "=" + }, + "0x0087": { + "group": "basic", + "key": "KC_INTERNATIONAL_1", + "label": "INT 1", + "aliases": [ + "KC_INT1" + ] + }, + "0x0088": { + "group": "basic", + "key": "KC_INTERNATIONAL_2", + "label": "INT 2", + "aliases": [ + "KC_INT2" + ] + }, + "0x0089": { + "group": "basic", + "key": "KC_INTERNATIONAL_3", + "label": "INT 3", + "aliases": [ + "KC_INT3" + ] + }, + "0x008a": { + "group": "basic", + "key": "KC_INTERNATIONAL_4", + "label": "INT 4", + "aliases": [ + "KC_INT4" + ] + }, + "0x008b": { + "group": "basic", + "key": "KC_INTERNATIONAL_5", + "label": "INT 5", + "aliases": [ + "KC_INT5" + ] + }, + "0x008c": { + "group": "basic", + "key": "KC_INTERNATIONAL_6", + "label": "INT 6", + "aliases": [ + "KC_INT6" + ] + }, + "0x008d": { + "group": "basic", + "key": "KC_INTERNATIONAL_7", + "label": "INT 7", + "aliases": [ + "KC_INT7" + ] + }, + "0x008e": { + "group": "basic", + "key": "KC_INTERNATIONAL_8", + "label": "INT 8", + "aliases": [ + "KC_INT8" + ] + }, + "0x008f": { + "group": "basic", + "key": "KC_INTERNATIONAL_9", + "label": "INT 9", + "aliases": [ + "KC_INT9" + ] + }, + "0x0090": { + "group": "basic", + "key": "KC_LANGUAGE_1", + "label": "LANG 1", + "aliases": [ + "KC_LNG1" + ] + }, + "0x0091": { + "group": "basic", + "key": "KC_LANGUAGE_2", + "label": "LANG 2", + "aliases": [ + "KC_LNG2" + ] + }, + "0x0092": { + "group": "basic", + "key": "KC_LANGUAGE_3", + "label": "LANG 3", + "aliases": [ + "KC_LNG3" + ] + }, + "0x0093": { + "group": "basic", + "key": "KC_LANGUAGE_4", + "label": "LANG 4", + "aliases": [ + "KC_LNG4" + ] + }, + "0x0094": { + "group": "basic", + "key": "KC_LANGUAGE_5", + "label": "LANG 5", + "aliases": [ + "KC_LNG5" + ] + }, + "0x0095": { + "group": "basic", + "key": "KC_LANGUAGE_6", + "label": "LANG 6", + "aliases": [ + "KC_LNG6" + ] + }, + "0x0096": { + "group": "basic", + "key": "KC_LANGUAGE_7", + "label": "LANG 7", + "aliases": [ + "KC_LNG7" + ] + }, + "0x0097": { + "group": "basic", + "key": "KC_LANGUAGE_8", + "label": "LANG 8", + "aliases": [ + "KC_LNG8" + ] + }, + "0x0098": { + "group": "basic", + "key": "KC_LANGUAGE_9", + "label": "LANG 9", + "aliases": [ + "KC_LNG9" + ] + }, + "0x0099": { + "group": "basic", + "key": "KC_ALTERNATE_ERASE", + "label": "Alternate Erase", + "aliases": [ + "KC_ERAS" + ] + }, + "0x009a": { + "group": "basic", + "key": "KC_SYSTEM_REQUEST", + "label": "SysReq/Attention", + "aliases": [ + "KC_SYRQ" + ] + }, + "0x009b": { + "group": "basic", + "key": "KC_CANCEL", + "label": "Cancel", + "aliases": [ + "KC_CNCL" + ] + }, + "0x009c": { + "group": "basic", + "key": "KC_CLEAR", + "label": "Clear", + "aliases": [ + "KC_CLR" + ] + }, + "0x009d": { + "group": "basic", + "key": "KC_PRIOR", + "label": "Prior", + "aliases": [ + "KC_PRIR" + ] + }, + "0x009e": { + "group": "basic", + "key": "KC_RETURN", + "label": "Return", + "aliases": [ + "KC_RETN" + ] + }, + "0x009f": { + "group": "basic", + "key": "KC_SEPARATOR", + "label": "Separator", + "aliases": [ + "KC_SEPR" + ] + }, + "0x00a0": { + "group": "basic", + "key": "KC_OUT", + "label": "Out" + }, + "0x00a1": { + "group": "basic", + "key": "KC_OPER", + "label": "Oper" + }, + "0x00a2": { + "group": "basic", + "key": "KC_CLEAR_AGAIN", + "label": "Clear/Again", + "aliases": [ + "KC_CLAG" + ] + }, + "0x00a3": { + "group": "basic", + "key": "KC_CRSEL", + "label": "CrSel/Props", + "aliases": [ + "KC_CRSL" + ] + }, + "0x00a4": { + "group": "basic", + "key": "KC_EXSEL", + "label": "ExSel", + "aliases": [ + "KC_EXSL" + ] + }, + + "0x00e0": { + "group": "basic", + "key": "KC_LEFT_CTRL", + "label": "Left Control", + "aliases": [ + "KC_LCTL" + ] + }, + "0x00e1": { + "group": "basic", + "key": "KC_LEFT_SHIFT", + "label": "Left Shift", + "aliases": [ + "KC_LSFT" + ] + }, + "0x00e2": { + "group": "basic", + "key": "KC_LEFT_ALT", + "label": "Left Alt", + "aliases": [ + "KC_LALT", + "KC_LOPT" + ] + }, + "0x00e3": { + "group": "basic", + "key": "KC_LEFT_GUI", + "label": "Left GUI", + "aliases": [ + "KC_LGUI", + "KC_LCMD", + "KC_LWIN" + ] + }, + "0x00e4": { + "group": "basic", + "key": "KC_RIGHT_CTRL", + "label": "Right Control", + "aliases": [ + "KC_RCTL" + ] + }, + "0x00e5": { + "group": "basic", + "key": "KC_RIGHT_SHIFT", + "label": "Right Shift", + "aliases": [ + "KC_RSFT" + ] + }, + "0x00e6": { + "group": "basic", + "key": "KC_RIGHT_ALT", + "label": "Right Alt", + "aliases": [ + "KC_RALT", + "KC_ROPT", + "KC_ALGR" + ] + }, + "0x00e7": { + "group": "basic", + "key": "KC_RIGHT_GUI", + "label": "Right GUI", + "aliases": [ + "KC_RGUI", + "KC_RCMD", + "KC_RWIN" + ] + }, + + "0x00ed": { + "group": "basic", + "key": "KC_MS_UP", + "label": "Move cursor up", + "aliases": [ + "KC_MS_U" + ] + }, + "0x00ee": { + "group": "basic", + "key": "KC_MS_DOWN", + "label": "Move cursor down", + "aliases": [ + "KC_MS_D" + ] + }, + "0x00ef": { + "group": "basic", + "key": "KC_MS_LEFT", + "label": "Move cursor left", + "aliases": [ + "KC_MS_L" + ] + }, + "0x00f0": { + "group": "basic", + "key": "KC_MS_LEFT", + "label": "Move cursor right", + "aliases": [ + "KC_MS_R" + ] + }, + "0x00f1": { + "group": "basic", + "key": "KC_MS_BTN1", + "label": "Press button 1", + "aliases": [ + "KC_BTN1" + ] + }, + "0x00f2": { + "group": "basic", + "key": "KC_MS_BTN2", + "label": "Press button 2", + "aliases": [ + "KC_BTN2" + ] + }, + "0x00f3": { + "group": "basic", + "key": "KC_MS_BTN3", + "label": "Press button 3", + "aliases": [ + "KC_BTN3" + ] + }, + "0x00f4": { + "group": "basic", + "key": "KC_MS_BTN4", + "label": "Press button 4", + "aliases": [ + "KC_BTN4" + ] + }, + "0x00f5": { + "group": "basic", + "key": "KC_MS_BTN5", + "label": "Press button 5", + "aliases": [ + "KC_BTN5" + ] + }, + "0x00f6": { + "group": "basic", + "key": "KC_MS_BTN6", + "label": "Press button 6", + "aliases": [ + "KC_BTN6" + ] + }, + "0x00f7": { + "group": "basic", + "key": "KC_MS_BTN7", + "label": "Press button 7", + "aliases": [ + "KC_BTN7" + ] + }, + "0x00f8": { + "group": "basic", + "key": "KC_MS_BTN8", + "label": "Press button 8", + "aliases": [ + "KC_BTN8" + ] + }, + "0x00f9": { + "group": "basic", + "key": "KC_MS_WH_UP", + "label": "Move wheel up", + "aliases": [ + "KC_WH_U" + ] + }, + "0x00fa": { + "group": "basic", + "key": "KC_MS_WH_DOWN", + "label": "Move wheel down", + "aliases": [ + "KC_WH_D" + ] + }, + "0x00fb": { + "group": "basic", + "key": "KC_MS_WH_LEFT", + "label": "Move wheel left", + "aliases": [ + "KC_WH_L" + ] + }, + "0x00fc": { + "group": "basic", + "key": "KC_MS_WH_RIGHT", + "label": "Move wheel right", + "aliases": [ + "KC_WH_R" + ] + }, + "0x00fd": { + "group": "basic", + "key": "KC_MS_ACCEL0", + "label": "Set speed to 0", + "aliases": [ + "KC_ACL0" + ] + }, + "0x00fe": { + "group": "basic", + "key": "KC_MS_ACCEL1", + "label": "Set speed to 1", + "aliases": [ + "KC_ACL1" + ] + }, + "0x00ff": { + "group": "basic", + "key": "KC_MS_ACCEL2", + "label": "Set speed to 2", + "aliases": [ + "KC_ACL2" + ] + } + } +} \ No newline at end of file diff --git a/data/xap/xap_0.1.0.hjson b/data/xap/xap_0.1.0.hjson index 9499314d4b..078997a0c5 100755 --- a/data/xap/xap_0.1.0.hjson +++ b/data/xap/xap_0.1.0.hjson @@ -1,6 +1,10 @@ { version: 0.1.0 + uses: { + keycodes: 0.0.1 + } + documentation: { order: [ broadcast_messages diff --git a/lib/python/qmk/cli/xap/xap.py b/lib/python/qmk/cli/xap/xap.py index a04970f608..7db2fbcbe3 100644 --- a/lib/python/qmk/cli/xap/xap.py +++ b/lib/python/qmk/cli/xap/xap.py @@ -4,17 +4,17 @@ import cmd import json import random import gzip +from pathlib import Path from platform import platform from milc import cli -KEYCODE_MAP = { - # TODO: this should be data driven... - 0x04: 'KC_A', - 0x05: 'KC_B', - 0x29: 'KC_ESCAPE', - 0xF9: 'KC_MS_WH_UP', -} +from qmk.json_schema import json_load + +# TODO: get from xap "uses" for the current device +keycode_version = '0.0.1' +spec = json_load(Path(f'data/constants/keycodes_{keycode_version}.json')) +KEYCODE_MAP = {int(k, 16): v.get('key') for k, v in spec['keycodes'].items()} def _is_xap_usage(x):