diff --git a/builddefs/build_vial.mk b/builddefs/build_vial.mk index 1002e93b5d..48953c78a7 100644 --- a/builddefs/build_vial.mk +++ b/builddefs/build_vial.mk @@ -6,8 +6,10 @@ TAP_DANCE_ENABLE ?= yes ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) OPT_DEFS += -DTAPPING_TERM_PER_KEY endif +CAPS_WORD_ENABLE ?= yes COMBO_ENABLE ?= yes KEY_OVERRIDE_ENABLE ?= yes +LAYER_LOCK_ENABLE ?= yes SRC += $(QUANTUM_DIR)/vial.c OPT_DEFS += -DVIAL_ENABLE -DNO_DEBUG -DSERIAL_NUMBER=\"vial:f64c2b3c\" @@ -26,7 +28,7 @@ ifeq ($(strip $(QMK_SETTINGS)), yes) OPT_DEFS += -DQMK_SETTINGS \ -DAUTO_SHIFT_NO_SETUP -DAUTO_SHIFT_REPEAT_PER_KEY -DAUTO_SHIFT_NO_AUTO_REPEAT_PER_KEY \ -DPERMISSIVE_HOLD_PER_KEY -DHOLD_ON_OTHER_KEY_PRESS_PER_KEY -DQUICK_TAP_TERM_PER_KEY -DRETRO_TAPPING_PER_KEY \ - -DCOMBO_TERM_PER_COMBO -DCHORDAL_HOLD -DFLOW_TAP_TERM=321 + -DCOMBO_TERM_PER_COMBO -DCHORDAL_HOLD -DFLOW_TAP_TERM=321 -DCAPS_WORD_INVERT_ON_SHIFT endif # Generate Vial layout definition header from JSON diff --git a/quantum/vial.c b/quantum/vial.c index f5019bb5bf..c1ae54777e 100644 --- a/quantum/vial.c +++ b/quantum/vial.c @@ -224,6 +224,16 @@ void vial_handle_cmd(uint8_t *msg, uint8_t length) { msg[0] = VIAL_TAP_DANCE_ENTRIES; msg[1] = VIAL_COMBO_ENTRIES; msg[2] = VIAL_KEY_OVERRIDE_ENTRIES; + + // The last byte of msg indicates optionally supported features. + msg[length - 1] = (0 +#ifdef CAPS_WORD_ENABLE + | (1 << 0) // Bit 0: Caps Word. +#endif +#ifdef LAYER_LOCK_ENABLE + | (1 << 1) // Bit 1: Layer Lock. +#endif + ); break; } #ifdef VIAL_TAP_DANCE_ENABLE diff --git a/quantum/vial_ensure_keycode.h b/quantum/vial_ensure_keycode.h index 1c0dff2962..0f31036e4e 100644 --- a/quantum/vial_ensure_keycode.h +++ b/quantum/vial_ensure_keycode.h @@ -352,6 +352,7 @@ _Static_assert(MO(1) == 0x5221, ""); _Static_assert(DF(1) == 0x5241, ""); _Static_assert(TG(1) == 0x5261, ""); _Static_assert(OSL(1) == 0x5281, ""); +_Static_assert(PDF(1) == 0x52E1, ""); _Static_assert(LM(1, KC_A) == 0x5024, ""); _Static_assert(OSM(MOD_RSFT) == 0x52B2, ""); _Static_assert(TT(1) == 0x52C1, ""); @@ -810,9 +811,13 @@ _Static_assert(MI_BENDU == 0x718F, ""); _Static_assert(RESET == 0x7C00, ""); +_Static_assert(QK_CAPS_WORD_TOGGLE == 0x7C73, ""); + _Static_assert(FN_MO13 == 0x7C77, ""); _Static_assert(FN_MO23 == 0x7C78, ""); +_Static_assert(QK_LAYER_LOCK == 0x7C7B, ""); + /* Ensure that we have 64 USERxx keycodes */ _Static_assert(QK_KB == 0x7E00, ""); _Static_assert(QK_KB_MAX == 0x7E3F, "");