From 0629774336d9beb67dfee109dc9cb5694cf0952b Mon Sep 17 00:00:00 2001 From: Alexey Osheychik Date: Sun, 17 May 2026 11:40:55 +0200 Subject: [PATCH] =?UTF-8?q?Add=20ESC=20key=20overrides:=20Ctrl=E2=86=92`?= =?UTF-8?q?=20and=20Shift=E2=86=92~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace QK_GESC with KC_ESC and use the Key Overrides feature to send backtick on Ctrl+ESC and tilde on Shift+ESC. --- CLAUDE.md | 25 +++++++++++++++++++ .../lotus58/keymaps/lotus/keymap.c | 11 +++++++- .../lotus58/keymaps/lotus/rules.mk | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..db61f1e8 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,25 @@ +# QMK Keyboard Configuration + +## MANDATORY: Documentation First + +Before editing ANY QMK configuration file, you MUST: +1. Fetch the relevant page from https://docs.qmk.fm to verify current API, functions, and macros +2. Never invent or guess function names — always confirm they exist in the official docs +3. If unsure whether a feature/function exists, check docs.qmk.fm before writing any code + +## Key documentation pages to check (by task): +- Keycodes: https://docs.qmk.fm/keycodes +- Layers: https://docs.qmk.fm/feature_layers +- Macros: https://docs.qmk.fm/feature_macros +- Tap Dance: https://docs.qmk.fm/feature_tap_dance +- Combos: https://docs.qmk.fm/feature_combo +- Custom shifts: https://docs.qmk.fm/feature_key_overrides +- config.h options: https://docs.qmk.fm/config_options + +## Rules +- Always use the exact function signatures from docs.qmk.fm +- Do not use functions from memory if they can be verified online +- If a docs page contradicts your training data, trust the docs page + +## Git +- Never mention Claude or Claude Code as author or co-author in commit messages diff --git a/keyboards/tweetydabird/lotus58/keymaps/lotus/keymap.c b/keyboards/tweetydabird/lotus58/keymaps/lotus/keymap.c index 1f682449..6390b748 100644 --- a/keyboards/tweetydabird/lotus58/keymaps/lotus/keymap.c +++ b/keyboards/tweetydabird/lotus58/keymaps/lotus/keymap.c @@ -2,6 +2,15 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include QMK_KEYBOARD_H +const key_override_t ctrl_esc_override = ko_make_basic(MOD_MASK_CTRL, KC_ESC, KC_GRV); +const key_override_t shift_esc_override = ko_make_basic(MOD_MASK_SHIFT, KC_ESC, S(KC_GRV)); + +const key_override_t *key_overrides[] = { + &ctrl_esc_override, + &shift_esc_override, + NULL +}; + // Define custom keycodes enum custom_keycodes { // F19 on tap, Hyper (Cmd+Ctrl+Opt+Shift) on hold @@ -10,7 +19,7 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( - QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MPLY, KC_MPLY, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MPLY, KC_MPLY, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, HYPER_F19, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TG(1), KC_9, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_BSLS), diff --git a/keyboards/tweetydabird/lotus58/keymaps/lotus/rules.mk b/keyboards/tweetydabird/lotus58/keymaps/lotus/rules.mk index 5ab7eb34..ea5cd328 100644 --- a/keyboards/tweetydabird/lotus58/keymaps/lotus/rules.mk +++ b/keyboards/tweetydabird/lotus58/keymaps/lotus/rules.mk @@ -1,6 +1,7 @@ CONVERT_TO=rp2040_ce ENCODER_MAP_ENABLE = yes +KEY_OVERRIDE_ENABLE = yes AUTO_SHIFT_ENABLE = no # CAPS_WORD_ENABLE = yes