diff --git a/.gitignore b/.gitignore index ea7ad925a8..e795ba3fb8 100644 --- a/.gitignore +++ b/.gitignore @@ -117,3 +117,4 @@ via*.json /.claude_session /.remember/tmp/save-session.pid /.direnv/CACHEDIR.TAG +/.gemini_session diff --git a/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/config.h b/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/config.h index 924e45b5ff..e9fd63dd8e 100644 --- a/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/config.h +++ b/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/config.h @@ -3,6 +3,16 @@ #pragma once +// Tight, strict combo window for a simultaneous 3-key press. +// This ensures the fallback combo only fires when intended. +#define COMBO_TERM 10 +#define COMBO_STRICT_TIMER + +// Use a more conservative debounce period (20ms is standard for Keychron) +// but since we switched to 'sym_defer_pk' in rules.mk, this will now +// require 20ms of STABILITY before a keypress is reported. +#define DEBOUNCE 20 + // 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 94c30c0c39..173888b756 100644 --- a/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/keymap.c +++ b/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/keymap.c @@ -169,6 +169,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { caps_mod_held = true; caps_mod_timer = timer_read(); + // If a real modifier is held, send a dummy key so the OS sees + // modifier+key rather than a bare modifier hold/tap. Without + // this, the OS never receives any keycode while the modifier is + // down and treats the eventual modifier release as a tap (e.g. + // GUI opening the app menu). KC_F24 is harmless and universally + // ignored by applications. + if (get_mods() & (MOD_MASK_GUI | MOD_MASK_ALT | MOD_MASK_SHIFT)) { + register_code(KC_F24); + unregister_code(KC_F24); + } } else { if (caps_mod_ctrl_registered) { unregister_code(KC_LCTL); 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 256b50f150..a2e60506ae 100644 --- a/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/rules.mk +++ b/keyboards/keychron/q5_max/ansi_encoder/keymaps/via/rules.mk @@ -5,3 +5,5 @@ COMBO_ENABLE = yes CAPS_WORD_ENABLE = yes AUTOCORRECT_ENABLE = yes SRC += chord_unicode.c + +DEBOUNCE_TYPE = sym_defer_pk