From ed8d36366d2fda97339f71c43ee7228828d14096 Mon Sep 17 00:00:00 2001 From: "B. G. Kendall" <69401250+bgkendall@users.noreply.github.com> Date: Sun, 28 Aug 2022 02:16:00 -0400 Subject: [PATCH 1/7] =?UTF-8?q?Provide=20better=20organised=20=E2=80=9CQua?= =?UTF-8?q?ntum=E2=80=9D=20tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/python/tabbed_keycodes.py | 4 ++-- src/main/python/widgets/display_keyboard_defs.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/python/tabbed_keycodes.py b/src/main/python/tabbed_keycodes.py index a16d21785c..68c26d858f 100644 --- a/src/main/python/tabbed_keycodes.py +++ b/src/main/python/tabbed_keycodes.py @@ -6,7 +6,7 @@ from constants import KEYCODE_BTN_RATIO from widgets.display_keyboard import DisplayKeyboard -from widgets.display_keyboard_defs import ansi_100, ansi_80, ansi_70, iso_100, iso_80, iso_70 +from widgets.display_keyboard_defs import ansi_100, ansi_80, ansi_70, iso_100, iso_80, iso_70, mods from widgets.flowlayout import FlowLayout from keycodes import KEYCODES_BASIC, KEYCODES_ISO, KEYCODES_MACRO, KEYCODES_LAYERS, KEYCODES_QUANTUM, \ KEYCODES_BACKLIGHT, KEYCODES_MEDIA, KEYCODES_SPECIAL, KEYCODES_SHIFTED, KEYCODES_USER, Keycode, \ @@ -172,7 +172,7 @@ def __init__(self, parent=None, keycode_filter=keycode_filter_any): (None, KEYCODES_ISO), ], prefix_buttons=[("Any", -1)]), SimpleTab(self, "Layers", KEYCODES_LAYERS), - SimpleTab(self, "Quantum", KEYCODES_QUANTUM), + Tab(self, "Quantum", [(mods, []), (None, KEYCODES_QUANTUM)]), SimpleTab(self, "Backlight", KEYCODES_BACKLIGHT), SimpleTab(self, "App, Media and Mouse", KEYCODES_MEDIA), SimpleTab(self, "MIDI", KEYCODES_MIDI), diff --git a/src/main/python/widgets/display_keyboard_defs.py b/src/main/python/widgets/display_keyboard_defs.py index 830c154906..25a356f72a 100644 --- a/src/main/python/widgets/display_keyboard_defs.py +++ b/src/main/python/widgets/display_keyboard_defs.py @@ -23,3 +23,17 @@ iso_70 = r""" [["KC_ESCAPE",{"x":1},"KC_F1","KC_F2","KC_F3","KC_F4",{"x":0.5},"KC_F5","KC_F6","KC_F7","KC_F8",{"x":0.5},"KC_F9","KC_F10","KC_F11","KC_F12"],[{"y":0.25},"KC_GRAVE","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINUS","KC_EQUAL","KC_JYEN","KC_BSPACE"],[{"w":1.5},"KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_LBRACKET","KC_RBRACKET",{"x":0.25,"w":1.25,"h":2},"KC_ENTER"],[{"w":1.75},"KC_CAPSLOCK","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCOLON","KC_QUOTE","KC_NONUS_HASH"],[{"w":1.25},"KC_LSHIFT","KC_NONUS_BSLASH","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMMA","KC_DOT","KC_SLASH","KC_RO",{"w":1.75},"KC_RSHIFT"],[{"w":1.25},"KC_LCTRL",{"w":1.25},"KC_LGUI",{"w":1.25},"KC_LALT",{"w":1.25},"KC_MHEN",{"w":2.5},"KC_SPACE",{"w":1.25},"KC_HENK",{"w":1.25},"KC_KANA",{"w":1.25},"KC_RALT",{"w":1.25},"KC_RGUI",{"w":1.25},"KC_APPLICATION",{"w":1.25},"KC_RCTRL"]] """ + +mods = r""" +[["RESET",{"x":1},"KC_GESC","KC_LSPO","KC_RSPC","KC_LCPO","KC_RCPC","KC_LAPO","KC_RAPC","KC_SFTENT"], +[{"y":0.25},"OSM(MOD_LSFT)","OSM(MOD_LCTL)","OSM(MOD_LALT)","OSM(MOD_LGUI)",{"x":0.25},"OSM(MOD_RSFT)","OSM(MOD_RCTL)","OSM(MOD_RALT)","OSM(MOD_RGUI)",{"x":0.25},"OSM(MOD_LCTL|MOD_LSFT)","OSM(MOD_LCTL|MOD_LALT)","OSM(MOD_LCTL|MOD_LGUI)","OSM(MOD_LSFT|MOD_LALT)","OSM(MOD_LSFT|MOD_LGUI)","OSM(MOD_LALT|MOD_LGUI)","OSM(MOD_LCTL|MOD_LSFT|MOD_LGUI)","OSM(MOD_LCTL|MOD_LALT|MOD_LGUI)","OSM(MOD_LSFT|MOD_LALT|MOD_LGUI)","OSM(MOD_MEH)","OSM(MOD_HYPR)"], +[{"y":0.25},"LSFT(kc)","LCTL(kc)","LALT(kc)","LGUI(kc)",{"x":0.25},"RSFT(kc)","RCTL(kc)","RALT(kc)","RGUI(kc)",{"x":0.25},"C_S(kc)","LCA(kc)","LCG(kc)","LSA(kc)","SGUI(kc)","RCG(kc)",{"x":1},"LCAG(kc)",{"x":1},"MEH(kc)","HYPR(kc)"], +["LSFT_T(kc)","LCTL_T(kc)","LALT_T(kc)","LGUI_T(kc)",{"x":0.25},"RSFT_T(kc)","RCTL_T(kc)","RALT_T(kc)","RGUI_T(kc)",{"x":0.25},"C_S_T(kc)","LCA_T(kc)","LCG_T(kc)","LSA_T(kc)","SGUI_T(kc)","RCG_T(kc)","RCAG_T(kc)","LCAG_T(kc)",{"x":1},"MEH_T(kc)","ALL_T(kc)"], +[{"y":0.5},"MAGIC_SWAP_CONTROL_CAPSLOCK","MAGIC_CAPSLOCK_TO_CONTROL",{"x":0.25},"MAGIC_SWAP_LCTL_LGUI","MAGIC_SWAP_RCTL_RGUI","MAGIC_SWAP_CTL_GUI",{"x":1.25},"MAGIC_SWAP_LALT_LGUI","MAGIC_SWAP_RALT_RGUI","MAGIC_SWAP_ALT_GUI",{"x":1.25},"MAGIC_UNNO_GUI",{"x":0.25},"MAGIC_SWAP_GRAVE_ESC",{"x":0.25},"MAGIC_SWAP_BACKSLASH_BACKSPACE"], +[{"y":-0.5,"x":5.25},"MAGIC_TOGGLE_CTL_GUI",{"x":3.25},"MAGIC_TOGGLE_ALT_GUI"], +[{"y":-0.5},"MAGIC_UNSWAP_CONTROL_CAPSLOCK","MAGIC_UNCAPSLOCK_TO_CONTROL",{"x":0.25},"MAGIC_UNSWAP_LCTL_LGUI","MAGIC_UNSWAP_RCTL_RGUI","MAGIC_UNSWAP_CTL_GUI",{"x":1.25},"MAGIC_UNSWAP_LALT_LGUI","MAGIC_UNSWAP_RALT_RGUI","MAGIC_UNSWAP_ALT_GUI",{"x":1.25},"MAGIC_NO_GUI",{"x":0.25},"MAGIC_UNSWAP_GRAVE_ESC",{"x":0.25},"MAGIC_UNSWAP_BACKSLASH_BACKSPACE"], +[{"y":0.5},"MAGIC_HOST_NKRO","MAGIC_UNHOST_NKRO","MAGIC_TOGGLE_NKRO",{"x":1},"MAGIC_EE_HANDS_LEFT","MAGIC_EE_HANDS_RIGHT"], +["AU_ON","AU_OFF","AU_TOG",{"x":1},"CLICKY_TOGGLE","CLICKY_UP","CLICKY_DOWN","CLICKY_RESET",{"x":1},"MU_ON","MU_OFF","MU_TOG","MU_MOD"], +["HPT_ON","HPT_OFF","HPT_TOG","HPT_RST","HPT_FBK","HPT_BUZ","HPT_MODI","HPT_MODD","HPT_CONT","HPT_CONI","HPT_COND","HPT_DWLI","HPT_DWLD"], +["KC_ASDN","KC_ASUP","KC_ASRP","KC_ASON","KC_ASOFF","KC_ASTG",{"x":1},"CMB_ON","CMB_OFF","CMB_TOG"]] +""" From 674ba06d4da407c566fe6fa76cdad8306fe755ea Mon Sep 17 00:00:00 2001 From: "B. G. Kendall" <69401250+bgkendall@users.noreply.github.com> Date: Mon, 29 Aug 2022 01:27:59 -0400 Subject: [PATCH 2/7] Further updates to Quantum tab usability * Only attempt to organise modifier keys. All others will appear in the same order as before after the formatted modifiers. * Add narrower layout for organised modifiers. --- src/main/python/keycodes.py | 9 +++++++-- src/main/python/tabbed_keycodes.py | 9 ++++++--- .../python/widgets/display_keyboard_defs.py | 18 ++++++------------ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/main/python/keycodes.py b/src/main/python/keycodes.py index b5c590d550..7d6c733260 100644 --- a/src/main/python/keycodes.py +++ b/src/main/python/keycodes.py @@ -319,8 +319,11 @@ def LT(layer): RESET_KEYCODE = 0x5C00 -KEYCODES_QUANTUM = [ - K(RESET_KEYCODE, "RESET", "Reset", "Reboot to bootloader"), +KEYCODES_RESET = [ + K(RESET_KEYCODE, "RESET", "Reset", "Reboot to bootloader") +] + +KEYCODES_MODIFIERS = [ K(QK_ONE_SHOT_MOD | MOD_LSFT, "OSM(MOD_LSFT)", "OSM\nLSft", "Enable Left Shift for one keypress"), K(QK_ONE_SHOT_MOD | MOD_LCTL, "OSM(MOD_LCTL)", "OSM\nLCtl", "Enable Left Control for one keypress"), K(QK_ONE_SHOT_MOD | MOD_LALT, "OSM(MOD_LALT)", "OSM\nLAlt", "Enable Left Alt for one keypress"), @@ -402,7 +405,9 @@ def LT(layer): K(0x5CF5, "KC_LAPO", "LA\n(", "Left Alt when held, ( when tapped"), K(0x5CF6, "KC_RAPC", "RA\n)", "Right Alt when held, ) when tapped"), K(0x5CD9, "KC_SFTENT", "RS\nEnter", "Right Shift when held, Enter when tapped"), +] +KEYCODES_QUANTUM = [ K(23554, "MAGIC_SWAP_CONTROL_CAPSLOCK", "Swap\nCtrl\nCaps", "Swap Caps Lock and Left Control", alias=["CL_SWAP"]), K(23563, "MAGIC_UNSWAP_CONTROL_CAPSLOCK", "Unswap\nCtrl\nCaps", "Unswap Caps Lock and Left Control", alias=["CL_NORM"]), diff --git a/src/main/python/tabbed_keycodes.py b/src/main/python/tabbed_keycodes.py index 68c26d858f..5f08bcabac 100644 --- a/src/main/python/tabbed_keycodes.py +++ b/src/main/python/tabbed_keycodes.py @@ -6,11 +6,12 @@ from constants import KEYCODE_BTN_RATIO from widgets.display_keyboard import DisplayKeyboard -from widgets.display_keyboard_defs import ansi_100, ansi_80, ansi_70, iso_100, iso_80, iso_70, mods +from widgets.display_keyboard_defs import ansi_100, ansi_80, ansi_70, iso_100, iso_80, iso_70, mods, mods_narrow from widgets.flowlayout import FlowLayout from keycodes import KEYCODES_BASIC, KEYCODES_ISO, KEYCODES_MACRO, KEYCODES_LAYERS, KEYCODES_QUANTUM, \ KEYCODES_BACKLIGHT, KEYCODES_MEDIA, KEYCODES_SPECIAL, KEYCODES_SHIFTED, KEYCODES_USER, Keycode, \ - KEYCODES_TAP_DANCE, KEYCODES_MIDI, KEYCODES_BASIC_NUMPAD, KEYCODES_BASIC_NAV, KEYCODES_ISO_KR + KEYCODES_TAP_DANCE, KEYCODES_MIDI, KEYCODES_BASIC_NUMPAD, KEYCODES_BASIC_NAV, KEYCODES_ISO_KR, \ + KEYCODES_RESET, KEYCODES_MODIFIERS from widgets.square_button import SquareButton from util import tr, KeycodeDisplay @@ -172,7 +173,9 @@ def __init__(self, parent=None, keycode_filter=keycode_filter_any): (None, KEYCODES_ISO), ], prefix_buttons=[("Any", -1)]), SimpleTab(self, "Layers", KEYCODES_LAYERS), - Tab(self, "Quantum", [(mods, []), (None, KEYCODES_QUANTUM)]), + Tab(self, "Quantum", [(mods, (KEYCODES_RESET + KEYCODES_QUANTUM)), + (mods_narrow, (KEYCODES_RESET + KEYCODES_QUANTUM)), + (None, (KEYCODES_RESET + KEYCODES_MODIFIERS + KEYCODES_QUANTUM))]), SimpleTab(self, "Backlight", KEYCODES_BACKLIGHT), SimpleTab(self, "App, Media and Mouse", KEYCODES_MEDIA), SimpleTab(self, "MIDI", KEYCODES_MIDI), diff --git a/src/main/python/widgets/display_keyboard_defs.py b/src/main/python/widgets/display_keyboard_defs.py index 25a356f72a..07db992c1f 100644 --- a/src/main/python/widgets/display_keyboard_defs.py +++ b/src/main/python/widgets/display_keyboard_defs.py @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-License-Identifie"r": GPL-2.0-or-later ansi_100 = r""" [["KC_ESCAPE",{"x":1},"KC_F1","KC_F2","KC_F3","KC_F4",{"x":0.5},"KC_F5","KC_F6","KC_F7","KC_F8",{"x":0.5},"KC_F9","KC_F10","KC_F11","KC_F12",{"x":0.25},"KC_PSCREEN","KC_SCROLLLOCK","KC_PAUSE"],[{"y":0.25},"KC_GRAVE","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINUS","KC_EQUAL",{"w":2},"KC_BSPACE",{"x":0.25},"KC_INSERT","KC_HOME","KC_PGUP",{"x":0.25},"KC_NUMLOCK","KC_KP_SLASH","KC_KP_ASTERISK","KC_KP_MINUS"],[{"w":1.5},"KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_LBRACKET","KC_RBRACKET",{"w":1.5},"KC_BSLASH",{"x":0.25},"KC_DELETE","KC_END","KC_PGDOWN",{"x":0.25},"KC_KP_7","KC_KP_8","KC_KP_9","KC_KP_PLUS"],[{"w":1.75},"KC_CAPSLOCK","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCOLON","KC_QUOTE",{"w":2.25},"KC_ENTER",{"x":3.5},"KC_KP_4","KC_KP_5","KC_KP_6","KC_KP_COMMA"],[{"w":2.25},"KC_LSHIFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMMA","KC_DOT","KC_SLASH",{"w":2.75},"KC_RSHIFT",{"x":1.25},"KC_UP",{"x":1.25},"KC_KP_1","KC_KP_2","KC_KP_3","KC_KP_EQUAL"],[{"w":1.25},"KC_LCTRL",{"w":1.25},"KC_LGUI",{"w":1.25},"KC_LALT",{"w":6.25},"KC_SPACE",{"w":1.25},"KC_RALT",{"w":1.25},"KC_RGUI",{"w":1.25},"KC_APPLICATION",{"w":1.25},"KC_RCTRL",{"x":0.25},"KC_LEFT","KC_DOWN","KC_RIGHT",{"x":0.25,"w":2},"KC_KP_0","KC_KP_DOT","KC_KP_ENTER"]] @@ -25,15 +25,9 @@ """ mods = r""" -[["RESET",{"x":1},"KC_GESC","KC_LSPO","KC_RSPC","KC_LCPO","KC_RCPC","KC_LAPO","KC_RAPC","KC_SFTENT"], -[{"y":0.25},"OSM(MOD_LSFT)","OSM(MOD_LCTL)","OSM(MOD_LALT)","OSM(MOD_LGUI)",{"x":0.25},"OSM(MOD_RSFT)","OSM(MOD_RCTL)","OSM(MOD_RALT)","OSM(MOD_RGUI)",{"x":0.25},"OSM(MOD_LCTL|MOD_LSFT)","OSM(MOD_LCTL|MOD_LALT)","OSM(MOD_LCTL|MOD_LGUI)","OSM(MOD_LSFT|MOD_LALT)","OSM(MOD_LSFT|MOD_LGUI)","OSM(MOD_LALT|MOD_LGUI)","OSM(MOD_LCTL|MOD_LSFT|MOD_LGUI)","OSM(MOD_LCTL|MOD_LALT|MOD_LGUI)","OSM(MOD_LSFT|MOD_LALT|MOD_LGUI)","OSM(MOD_MEH)","OSM(MOD_HYPR)"], -[{"y":0.25},"LSFT(kc)","LCTL(kc)","LALT(kc)","LGUI(kc)",{"x":0.25},"RSFT(kc)","RCTL(kc)","RALT(kc)","RGUI(kc)",{"x":0.25},"C_S(kc)","LCA(kc)","LCG(kc)","LSA(kc)","SGUI(kc)","RCG(kc)",{"x":1},"LCAG(kc)",{"x":1},"MEH(kc)","HYPR(kc)"], -["LSFT_T(kc)","LCTL_T(kc)","LALT_T(kc)","LGUI_T(kc)",{"x":0.25},"RSFT_T(kc)","RCTL_T(kc)","RALT_T(kc)","RGUI_T(kc)",{"x":0.25},"C_S_T(kc)","LCA_T(kc)","LCG_T(kc)","LSA_T(kc)","SGUI_T(kc)","RCG_T(kc)","RCAG_T(kc)","LCAG_T(kc)",{"x":1},"MEH_T(kc)","ALL_T(kc)"], -[{"y":0.5},"MAGIC_SWAP_CONTROL_CAPSLOCK","MAGIC_CAPSLOCK_TO_CONTROL",{"x":0.25},"MAGIC_SWAP_LCTL_LGUI","MAGIC_SWAP_RCTL_RGUI","MAGIC_SWAP_CTL_GUI",{"x":1.25},"MAGIC_SWAP_LALT_LGUI","MAGIC_SWAP_RALT_RGUI","MAGIC_SWAP_ALT_GUI",{"x":1.25},"MAGIC_UNNO_GUI",{"x":0.25},"MAGIC_SWAP_GRAVE_ESC",{"x":0.25},"MAGIC_SWAP_BACKSLASH_BACKSPACE"], -[{"y":-0.5,"x":5.25},"MAGIC_TOGGLE_CTL_GUI",{"x":3.25},"MAGIC_TOGGLE_ALT_GUI"], -[{"y":-0.5},"MAGIC_UNSWAP_CONTROL_CAPSLOCK","MAGIC_UNCAPSLOCK_TO_CONTROL",{"x":0.25},"MAGIC_UNSWAP_LCTL_LGUI","MAGIC_UNSWAP_RCTL_RGUI","MAGIC_UNSWAP_CTL_GUI",{"x":1.25},"MAGIC_UNSWAP_LALT_LGUI","MAGIC_UNSWAP_RALT_RGUI","MAGIC_UNSWAP_ALT_GUI",{"x":1.25},"MAGIC_NO_GUI",{"x":0.25},"MAGIC_UNSWAP_GRAVE_ESC",{"x":0.25},"MAGIC_UNSWAP_BACKSLASH_BACKSPACE"], -[{"y":0.5},"MAGIC_HOST_NKRO","MAGIC_UNHOST_NKRO","MAGIC_TOGGLE_NKRO",{"x":1},"MAGIC_EE_HANDS_LEFT","MAGIC_EE_HANDS_RIGHT"], -["AU_ON","AU_OFF","AU_TOG",{"x":1},"CLICKY_TOGGLE","CLICKY_UP","CLICKY_DOWN","CLICKY_RESET",{"x":1},"MU_ON","MU_OFF","MU_TOG","MU_MOD"], -["HPT_ON","HPT_OFF","HPT_TOG","HPT_RST","HPT_FBK","HPT_BUZ","HPT_MODI","HPT_MODD","HPT_CONT","HPT_CONI","HPT_COND","HPT_DWLI","HPT_DWLD"], -["KC_ASDN","KC_ASUP","KC_ASRP","KC_ASON","KC_ASOFF","KC_ASTG",{"x":1},"CMB_ON","CMB_OFF","CMB_TOG"]] +[["KC_GESC",{"x":0.75,"w":1.25},"KC_LSPO",{"w":1.25},"KC_RSPC",{"x":0.25,"w":1.25},"KC_LCPO",{"w":1.25},"KC_RCPC",{"x":0.25,"w":1.25},"KC_LAPO",{"w":1.25},"KC_RAPC",{"x":0.5,"w":2.25},"KC_SFTENT"],[{"y":0.5},"OSM(MOD_LSFT)","OSM(MOD_LCTL)","OSM(MOD_LALT)","OSM(MOD_LGUI)",{"x":0.25},"OSM(MOD_RSFT)","OSM(MOD_RCTL)","OSM(MOD_RALT)","OSM(MOD_RGUI)",{"x":0.25},"OSM(MOD_LCTL|MOD_LSFT)","OSM(MOD_LCTL|MOD_LALT)","OSM(MOD_LCTL|MOD_LGUI)","OSM(MOD_LCTL|MOD_LSFT|MOD_LGUI)","OSM(MOD_LSFT|MOD_LALT)","OSM(MOD_LSFT|MOD_LGUI)","OSM(MOD_LSFT|MOD_LALT|MOD_LGUI)","OSM(MOD_LCTL|MOD_LALT|MOD_LGUI)","OSM(MOD_LALT|MOD_LGUI)","OSM(MOD_MEH)","OSM(MOD_HYPR)"],["LSFT(kc)","LCTL(kc)","LALT(kc)","LGUI(kc)",{"x":0.25},"RSFT(kc)","RCTL(kc)","RALT(kc)","RGUI(kc)",{"x":0.25},"C_S(kc)","LCA(kc)","LCG(kc)","RCG(kc)","LSA(kc)","SGUI(kc)",{"x":1},"LCAG(kc)",{"x":1},"MEH(kc)","HYPR(kc)"],["LSFT_T(kc)","LCTL_T(kc)","LALT_T(kc)","LGUI_T(kc)",{"x":0.25},"RSFT_T(kc)","RCTL_T(kc)","RALT_T(kc)","RGUI_T(kc)",{"x":0.25},"C_S_T(kc)","LCA_T(kc)","LCG_T(kc)","RCG_T(kc)","LSA_T(kc)","SGUI_T(kc)",{"x":1},"LCAG_T(kc)","RCAG_T(kc)","MEH_T(kc)","ALL_T(kc)"]] +""" + +mods_narrow = r""" +[["KC_GESC",{"x":0.75},"KC_LSPO","KC_RSPC",{"x":0.5},"KC_LCPO","KC_RCPC",{"x":0.5},"KC_LAPO","KC_RAPC",{"x":0.5,"w":1.25},"KC_SFTENT"],[{"y":0.5},"OSM(MOD_LSFT)","OSM(MOD_LCTL)","OSM(MOD_LALT)","OSM(MOD_LGUI)",{"x":0.5},"OSM(MOD_LCTL|MOD_LSFT)","OSM(MOD_LCTL|MOD_LALT)","OSM(MOD_LCTL|MOD_LGUI)","OSM(MOD_LCTL|MOD_LSFT|MOD_LGUI)","OSM(MOD_LSFT|MOD_LALT)","OSM(MOD_LSFT|MOD_LGUI)"],["OSM(MOD_RSFT)","OSM(MOD_RCTL)","OSM(MOD_RALT)","OSM(MOD_RGUI)",{"x":0.5},"OSM(MOD_LSFT|MOD_LALT|MOD_LGUI)","OSM(MOD_LCTL|MOD_LALT|MOD_LGUI)","OSM(MOD_LALT|MOD_LGUI)","OSM(MOD_MEH)","OSM(MOD_HYPR)"],["LSFT(kc)","LCTL(kc)","LALT(kc)","LGUI(kc)",{"x":0.5},"C_S(kc)","LCA(kc)","LCG(kc)","RCG(kc)","LSA(kc)","SGUI(kc)"],["RSFT(kc)","RCTL(kc)","RALT(kc)","RGUI(kc)",{"x":1.5},"LCAG(kc)",{"x":1},"MEH(kc)","HYPR(kc)"],["LSFT_T(kc)","LCTL_T(kc)","LALT_T(kc)","LGUI_T(kc)",{"x":0.5},"C_S_T(kc)","LCA_T(kc)","LCG_T(kc)","RCG_T(kc)","LSA_T(kc)","SGUI_T(kc)"],["RSFT_T(kc)","RCTL_T(kc)","RALT_T(kc)","RGUI_T(kc)",{"x":1.5},"LCAG_T(kc)","RCAG_T(kc)","MEH_T(kc)","ALL_T(kc)"]] """ From e4bab78fad7b0097080684f6208ccb93ccf011db Mon Sep 17 00:00:00 2001 From: Juan Pablo Kutianski Date: Mon, 29 Aug 2022 21:22:16 -0300 Subject: [PATCH 3/7] Added Swedish SWERTY layout (#129) --- src/main/python/keymap/swedish_swerty.py | 25 ++++++++++++++++++++++++ src/main/python/keymaps.py | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/main/python/keymap/swedish_swerty.py diff --git a/src/main/python/keymap/swedish_swerty.py b/src/main/python/keymap/swedish_swerty.py new file mode 100644 index 0000000000..d5f983cf67 --- /dev/null +++ b/src/main/python/keymap/swedish_swerty.py @@ -0,0 +1,25 @@ +# coding: utf-8 + +keymap = { + "KC_GRAVE": "~ ½\n` §", + "KC_2": '@\n2 "', + "KC_3": "#\n3 £", + "KC_4": "$\n4 ¤", + "KC_5": "%\n5 €", + "KC_6": "^\n6 ^", + "KC_7": "&\n7 {", + "KC_8": "*\n8 [", + "KC_9": "(\n9 ]", + "KC_0": ")\n0 }", + "KC_MINUS": "_ ^\n- ¨", + "KC_EQUAL": "+\n= ~", + "KC_E": "E\n €", + "KC_O": "O\n {", + "KC_P": "P\n }", + "KC_LBRACKET": "Å {\n [", + "KC_RBRACKET": "´ }\n` ]", + "KC_SCOLON": "Ö :\n ;", + "KC_QUOTE": 'Ä "\n \'', + "KC_M": "M\n µ", + "KC_DOT": ">\n. :" +} diff --git a/src/main/python/keymaps.py b/src/main/python/keymaps.py index 9ced2eb6d4..9fb3e47f4f 100644 --- a/src/main/python/keymaps.py +++ b/src/main/python/keymaps.py @@ -1,5 +1,5 @@ from keycodes import Keycode -from keymap import danish, eurkey, french, german, hebrew, hungarian, latam, norwegian, russian, slovak, spanish, swedish, swiss +from keymap import danish, eurkey, french, german, hebrew, hungarian, latam, norwegian, russian, slovak, spanish, swedish, swedish_swerty, swiss KEYMAPS = [ ("QWERTY", dict()), @@ -15,6 +15,7 @@ ("Slovak (QWERTY)", slovak.keymap), ("Spanish (QWERTY)", spanish.keymap), ("Swedish (QWERTY)", swedish.keymap), + ("Swedish (SWERTY)", swedish_swerty.keymap), ("Swiss (QWERTZ)", swiss.keymap) ] From 4ecb14ca5e046238266edd58db864d2f577edd89 Mon Sep 17 00:00:00 2001 From: "B. G. Kendall" <69401250+bgkendall@users.noreply.github.com> Date: Sun, 4 Sep 2022 15:53:19 -0400 Subject: [PATCH 4/7] Minor tweak to modifier organisation change * Renamed `KEYCODES_RESET` to `KEYCODES_BOOT` since `RESET` will become `QK_BOOT` in the near future. * Reordered includes to minimise changes in pull request. * Remover spurious `"` --- src/main/python/keycodes.py | 2 +- src/main/python/tabbed_keycodes.py | 10 +++++----- src/main/python/widgets/display_keyboard_defs.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/python/keycodes.py b/src/main/python/keycodes.py index 7d6c733260..aa3aae5f67 100644 --- a/src/main/python/keycodes.py +++ b/src/main/python/keycodes.py @@ -319,7 +319,7 @@ def LT(layer): RESET_KEYCODE = 0x5C00 -KEYCODES_RESET = [ +KEYCODES_BOOT = [ K(RESET_KEYCODE, "RESET", "Reset", "Reboot to bootloader") ] diff --git a/src/main/python/tabbed_keycodes.py b/src/main/python/tabbed_keycodes.py index 5f08bcabac..0e044f4536 100644 --- a/src/main/python/tabbed_keycodes.py +++ b/src/main/python/tabbed_keycodes.py @@ -9,9 +9,9 @@ from widgets.display_keyboard_defs import ansi_100, ansi_80, ansi_70, iso_100, iso_80, iso_70, mods, mods_narrow from widgets.flowlayout import FlowLayout from keycodes import KEYCODES_BASIC, KEYCODES_ISO, KEYCODES_MACRO, KEYCODES_LAYERS, KEYCODES_QUANTUM, \ + KEYCODES_BOOT, KEYCODES_MODIFIERS, \ KEYCODES_BACKLIGHT, KEYCODES_MEDIA, KEYCODES_SPECIAL, KEYCODES_SHIFTED, KEYCODES_USER, Keycode, \ - KEYCODES_TAP_DANCE, KEYCODES_MIDI, KEYCODES_BASIC_NUMPAD, KEYCODES_BASIC_NAV, KEYCODES_ISO_KR, \ - KEYCODES_RESET, KEYCODES_MODIFIERS + KEYCODES_TAP_DANCE, KEYCODES_MIDI, KEYCODES_BASIC_NUMPAD, KEYCODES_BASIC_NAV, KEYCODES_ISO_KR from widgets.square_button import SquareButton from util import tr, KeycodeDisplay @@ -173,9 +173,9 @@ def __init__(self, parent=None, keycode_filter=keycode_filter_any): (None, KEYCODES_ISO), ], prefix_buttons=[("Any", -1)]), SimpleTab(self, "Layers", KEYCODES_LAYERS), - Tab(self, "Quantum", [(mods, (KEYCODES_RESET + KEYCODES_QUANTUM)), - (mods_narrow, (KEYCODES_RESET + KEYCODES_QUANTUM)), - (None, (KEYCODES_RESET + KEYCODES_MODIFIERS + KEYCODES_QUANTUM))]), + Tab(self, "Quantum", [(mods, (KEYCODES_BOOT + KEYCODES_QUANTUM)), + (mods_narrow, (KEYCODES_BOOT + KEYCODES_QUANTUM)), + (None, (KEYCODES_BOOT + KEYCODES_MODIFIERS + KEYCODES_QUANTUM))]), SimpleTab(self, "Backlight", KEYCODES_BACKLIGHT), SimpleTab(self, "App, Media and Mouse", KEYCODES_MEDIA), SimpleTab(self, "MIDI", KEYCODES_MIDI), diff --git a/src/main/python/widgets/display_keyboard_defs.py b/src/main/python/widgets/display_keyboard_defs.py index 07db992c1f..6e36d298bc 100644 --- a/src/main/python/widgets/display_keyboard_defs.py +++ b/src/main/python/widgets/display_keyboard_defs.py @@ -1,4 +1,4 @@ -# SPDX-License-Identifie"r": GPL-2.0-or-later +# SPDX-License-Identifier: GPL-2.0-or-later ansi_100 = r""" [["KC_ESCAPE",{"x":1},"KC_F1","KC_F2","KC_F3","KC_F4",{"x":0.5},"KC_F5","KC_F6","KC_F7","KC_F8",{"x":0.5},"KC_F9","KC_F10","KC_F11","KC_F12",{"x":0.25},"KC_PSCREEN","KC_SCROLLLOCK","KC_PAUSE"],[{"y":0.25},"KC_GRAVE","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINUS","KC_EQUAL",{"w":2},"KC_BSPACE",{"x":0.25},"KC_INSERT","KC_HOME","KC_PGUP",{"x":0.25},"KC_NUMLOCK","KC_KP_SLASH","KC_KP_ASTERISK","KC_KP_MINUS"],[{"w":1.5},"KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_LBRACKET","KC_RBRACKET",{"w":1.5},"KC_BSLASH",{"x":0.25},"KC_DELETE","KC_END","KC_PGDOWN",{"x":0.25},"KC_KP_7","KC_KP_8","KC_KP_9","KC_KP_PLUS"],[{"w":1.75},"KC_CAPSLOCK","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCOLON","KC_QUOTE",{"w":2.25},"KC_ENTER",{"x":3.5},"KC_KP_4","KC_KP_5","KC_KP_6","KC_KP_COMMA"],[{"w":2.25},"KC_LSHIFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMMA","KC_DOT","KC_SLASH",{"w":2.75},"KC_RSHIFT",{"x":1.25},"KC_UP",{"x":1.25},"KC_KP_1","KC_KP_2","KC_KP_3","KC_KP_EQUAL"],[{"w":1.25},"KC_LCTRL",{"w":1.25},"KC_LGUI",{"w":1.25},"KC_LALT",{"w":6.25},"KC_SPACE",{"w":1.25},"KC_RALT",{"w":1.25},"KC_RGUI",{"w":1.25},"KC_APPLICATION",{"w":1.25},"KC_RCTRL",{"x":0.25},"KC_LEFT","KC_DOWN","KC_RIGHT",{"x":0.25,"w":2},"KC_KP_0","KC_KP_DOT","KC_KP_ENTER"]] From 4b22e276a7b76afd66721ef53df7f5248b86624f Mon Sep 17 00:00:00 2001 From: "B. G. Kendall" <69401250+bgkendall@users.noreply.github.com> Date: Sun, 4 Sep 2022 16:11:26 -0400 Subject: [PATCH 5/7] Fix missing mouse over text for RESET and Modifiers --- src/main/python/keycodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/python/keycodes.py b/src/main/python/keycodes.py index aa3aae5f67..e9d90b4746 100644 --- a/src/main/python/keycodes.py +++ b/src/main/python/keycodes.py @@ -779,8 +779,8 @@ def recreate_keycodes(): KEYCODES.clear() KEYCODES.extend(KEYCODES_SPECIAL + KEYCODES_BASIC + KEYCODES_SHIFTED + KEYCODES_ISO + KEYCODES_LAYERS + - KEYCODES_QUANTUM + KEYCODES_BACKLIGHT + KEYCODES_MEDIA + KEYCODES_TAP_DANCE + KEYCODES_MACRO + - KEYCODES_USER + KEYCODES_HIDDEN + KEYCODES_MIDI) + KEYCODES_BOOT + KEYCODES_MODIFIERS + KEYCODES_QUANTUM + KEYCODES_BACKLIGHT + KEYCODES_MEDIA + + KEYCODES_TAP_DANCE + KEYCODES_MACRO + KEYCODES_USER + KEYCODES_HIDDEN + KEYCODES_MIDI) KEYCODES_MAP.clear() for keycode in KEYCODES: KEYCODES_MAP[keycode.code] = keycode From 9e607f8b46ceac15c44c40a963b89f2155dfb56e Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Sun, 11 Sep 2022 18:03:11 -0600 Subject: [PATCH 6/7] add an example keyboard prefix so that we don't have to keep adding example keyboard IDs --- src/main/python/main_window.py | 11 ++++++----- src/main/python/util.py | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/python/main_window.py b/src/main/python/main_window.py index 89fe8d23b8..8b660c48b1 100644 --- a/src/main/python/main_window.py +++ b/src/main/python/main_window.py @@ -27,7 +27,7 @@ from tabbed_keycodes import TabbedKeycodes from editor.tap_dance import TapDance from unlocker import Unlocker -from util import tr, EXAMPLE_KEYBOARDS, KeycodeDisplay +from util import tr, EXAMPLE_KEYBOARDS, KeycodeDisplay, EXAMPLE_KEYBOARD_PREFIX from vial_device import VialKeyboard from editor.matrix_test import MatrixTest @@ -279,10 +279,11 @@ def on_device_selected(self): QMessageBox.warning(self, "", "Unsupported protocol version!\n" "Please download latest Vial from https://get.vial.today/") - if isinstance(self.autorefresh.current_device, VialKeyboard) \ - and self.autorefresh.current_device.keyboard.keyboard_id in EXAMPLE_KEYBOARDS: - QMessageBox.warning(self, "", "An example keyboard UID was detected.\n" - "Please change your keyboard UID to be unique before you ship!") + if isinstance(self.autorefresh.current_device, VialKeyboard): + keyboard_id = self.autorefresh.current_device.keyboard.keyboard_id + if (keyboard_id in EXAMPLE_KEYBOARDS) or ((keyboard_id & 0xFFFFFFFFFFFFFF) == EXAMPLE_KEYBOARD_PREFIX): + QMessageBox.warning(self, "", "An example keyboard UID was detected.\n" + "Please change your keyboard UID to be unique before you ship!") self.rebuild() self.refresh_tabs() diff --git a/src/main/python/util.py b/src/main/python/util.py index 1a491be61a..01a1140654 100644 --- a/src/main/python/util.py +++ b/src/main/python/util.py @@ -32,6 +32,9 @@ 0xBED2D31EC59A0BD8, # vial_stm32f401 ] +# anything starting with this prefix should not be allowed +EXAMPLE_KEYBOARD_PREFIX = 0xA6867BDFD3B00F + def hid_send(dev, msg, retries=1): if len(msg) > MSG_LEN: From ddc57e4eb1ef126940186015c13073bd930a58ed Mon Sep 17 00:00:00 2001 From: Nisker Date: Mon, 26 Sep 2022 18:19:56 +0200 Subject: [PATCH 7/7] Increased possible macros --- src/main/python/editor/macro_recorder.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/python/editor/macro_recorder.py b/src/main/python/editor/macro_recorder.py index f9bd27bb0d..a8269ac341 100644 --- a/src/main/python/editor/macro_recorder.py +++ b/src/main/python/editor/macro_recorder.py @@ -47,15 +47,6 @@ def __init__(self): self.recording_append = False self.tabs = TabWidgetWithKeycodes() - for x in range(32): - tab = MacroTab(self, self.recorder is not None) - tab.changed.connect(self.on_change) - tab.record.connect(self.on_record) - tab.record_stop.connect(self.on_tab_stop) - self.macro_tabs.append(tab) - w = QWidget() - w.setLayout(tab) - self.macro_tab_w.append(w) self.lbl_memory = QLabel() @@ -81,6 +72,16 @@ def rebuild(self, device): return self.keyboard = self.device.keyboard + for x in range(self.keyboard.macro_count - len(self.macro_tab_w)): + tab = MacroTab(self, self.recorder is not None) + tab.changed.connect(self.on_change) + tab.record.connect(self.on_record) + tab.record_stop.connect(self.on_tab_stop) + self.macro_tabs.append(tab) + w = QWidget() + w.setLayout(tab) + self.macro_tab_w.append(w) + # only show the number of macro editors that keyboard supports while self.tabs.count() > 0: self.tabs.removeTab(0)