From 2c2a2dfd7ad9c5c7ad3f70e31d3a03239c555665 Mon Sep 17 00:00:00 2001 From: Pascal Getreuer Date: Tue, 24 Jun 2025 17:05:12 -0700 Subject: [PATCH] Caps Word and Layer Lock for vial-qmk. * Enable Caps Word and Layer Lock. Set CAPS_WORD_INVERT_ON_SHIFT. * Use the last bits of dynamic_vial_get_number_of_entries to indicate optionally supported features. * Vial protocol version was already bumped to 6, matching the bump on made on the GUI side corresponding to this change. --- builddefs/build_vial.mk | 4 +++- quantum/vial.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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