From 86cad58f3459387993b0137e857f9fc1ac9d24d3 Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 6 Apr 2026 23:45:40 -0400 Subject: [PATCH] feat(q5_max): add COMM+DOT+SLSH fallback combo to return to BASE Adds a three-key combo (, . /) that fires TO(BASE), providing an emergency escape hatch when stuck on an unknown layer. COMBO_ONLY_FROM_LAYER is set to 0 in the keymap config.h so keycodes are always resolved from BASE, making the combo reliable regardless of the active layer. --- .../keychron/q5_max/ansi_encoder/keymaps/via/config.h | 8 ++++++++ .../keychron/q5_max/ansi_encoder/keymaps/via/keymap.c | 9 +++++++++ .../keychron/q5_max/ansi_encoder/keymaps/via/rules.mk | 1 + 3 files changed, 18 insertions(+) create mode 100644 keyboards/keychron/q5_max/ansi_encoder/keymaps/via/config.h diff --git a/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/config.h b/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/config.h new file mode 100644 index 0000000000..924e45b5ff --- /dev/null +++ b/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/config.h @@ -0,0 +1,8 @@ +// Copyright 2024 rootiest +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// Always resolve combo keycodes from BASE (layer 0) so the +// COMM+DOT+SLSH fallback combo fires regardless of the active layer. +#define COMBO_ONLY_FROM_LAYER 0 diff --git a/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/keymap.c b/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/keymap.c index c343a075ce..e4deb8e18d 100644 --- a/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/keymap.c +++ b/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/keymap.c @@ -108,6 +108,15 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { // clang-format on +// Combos ----------------------------------------------------------------- +// COMM + DOT + SLSH → TO(BASE): emergency fallback to base layer. +// COMBO_ONLY_FROM_LAYER 0 (config.h) ensures these keycodes are always +// resolved from BASE so the combo fires regardless of the active layer. +const uint16_t PROGMEM fallback_combo[] = {KC_COMM, KC_DOT, KC_SLSH, COMBO_END}; +combo_t key_combos[] = { + COMBO(fallback_combo, TO(BASE)), +}; + void keyboard_post_init_user(void) { chord_init(); // Use the Linux unicode input method (Ctrl+Shift+U → hex → Enter). diff --git a/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/rules.mk b/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/rules.mk index d41444a388..889884d162 100644 --- a/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/rules.mk +++ b/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/rules.mk @@ -1,4 +1,5 @@ VIA_ENABLE = yes TAP_DANCE_ENABLE = yes UNICODE_ENABLE = yes +COMBO_ENABLE = yes SRC += chord_unicode.c