keycodes: allow TD() keycodes but don't show them

main
Ilya Zhuravlev 2021-05-22 16:21:27 -04:00
parent 67ea09494c
commit c109143397
2 changed files with 15 additions and 1 deletions

View File

@ -14,6 +14,7 @@ QK_DEF_LAYER = 0x5200
QK_TOGGLE_LAYER = 0x5300
QK_ONE_SHOT_LAYER = 0x5400
QK_ONE_SHOT_MOD = 0x5500
QK_TAP_DANCE = 0x5700
QK_LAYER_TAP_TOGGLE = 0x5800
QK_LAYER_MOD = 0x5900
QK_MOD_TAP = 0x6000
@ -58,6 +59,7 @@ def LM(layer, mod): return (QK_LAYER_MOD | (((layer)&0xF) << 4) | ((mod)&0xF))
def OSM(mod): return (QK_ONE_SHOT_MOD | ((mod)&0xFF))
def TT(layer): return (QK_LAYER_TAP_TOGGLE | ((layer)&0xFF))
def MT(mod, kc): return (QK_MOD_TAP | (((mod)&0x1F) << 8) | ((kc)&0xFF))
def TD(n): return (QK_TAP_DANCE | ((n)&0xFF))
def LCTL_T(kc): return MT(MOD_LCTL, kc)
@ -96,6 +98,7 @@ functions = {
"C_S_T": C_S_T, "MEH_T": MEH_T,
"LCAG_T": LCAG_T, "RCAG_T": RCAG_T, "HYPR_T": HYPR_T, "SGUI_T": SGUI_T, "SCMD_T": SGUI_T, "SWIN_T": SGUI_T,
"LCA_T": LCA_T, "LSA_T": LSA_T, "RSA_T": RSA_T, "RCS_T": RCS_T, "SAGR_T": RSA_T, "ALL_T": HYPR_T,
"TD": TD,
}

View File

@ -528,6 +528,12 @@ KEYCODES_USER = []
KEYCODES_MACRO = []
KEYCODES_HIDDEN = []
for x in range(256):
from any_keycode import QK_TAP_DANCE
KEYCODES_HIDDEN.append(K(QK_TAP_DANCE | x, "TD({})".format(x), "TD({})".format(x)))
KEYCODES = []
K = None
@ -538,7 +544,9 @@ def recreate_keycodes():
KEYCODES.clear()
KEYCODES.extend(KEYCODES_SPECIAL + KEYCODES_BASIC + KEYCODES_SHIFTED + KEYCODES_ISO + KEYCODES_LAYERS +
KEYCODES_QUANTUM + KEYCODES_BACKLIGHT + KEYCODES_MEDIA + KEYCODES_MACRO + KEYCODES_USER)
KEYCODES_QUANTUM + KEYCODES_BACKLIGHT + KEYCODES_MEDIA + KEYCODES_MACRO + KEYCODES_USER +
KEYCODES_HIDDEN)
def create_user_keycodes():
KEYCODES_USER.clear()
@ -552,6 +560,7 @@ def create_user_keycodes():
)
)
def create_custom_user_keycodes(custom_keycodes):
KEYCODES_USER.clear()
for x, c_keycode in enumerate(custom_keycodes):
@ -564,6 +573,7 @@ def create_custom_user_keycodes(custom_keycodes):
)
)
def recreate_keyboard_keycodes(keyboard):
""" Generates keycodes based on information the keyboard provides (e.g. layer keycodes, macros) """
@ -606,4 +616,5 @@ def recreate_keyboard_keycodes(keyboard):
recreate_keycodes()
recreate_keycodes()