[Docs] Show how to flip semicolon and colon (#26030)

* Show how to flip semicolon and colon

* Apply whitespace suggestions from code review

Co-authored-by: Drashna Jaelre <drashna@live.com>

* Match line-wrapping

Co-authored-by: Joel Challis <git@zvecr.com>

---------

Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Joel Challis <git@zvecr.com>
This commit is contained in:
Peter Cock 2026-03-10 02:41:03 +00:00 committed by GitHub
parent acdc8a1374
commit 01e30d407c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -47,6 +47,17 @@ const key_override_t *key_overrides[] = {
}; };
``` ```
This second example inverts or swaps semicolon and colon on ANSI and many other layouts. That means pressing the key alone sends `shift` + `semicolon` giving `colon` (`S(KP_SCLN)` aka `KC_COLN`), but when pressing the key with shift, the shift modifier is suppressed (see `suppressed_mods` below), sending only `semicolon` (`KC_SCLN`):
```c
const key_override_t semicolon_colon_key_override = ko_make_basic(MOD_MASK_SHIFT, KC_COLN, KC_SCLN);
// This globally defines all key overrides to be used
const key_override_t *key_overrides[] = {
&semicolon_colon_key_override
};
```
## Intermediate Difficulty Examples {#intermediate-difficulty-examples} ## Intermediate Difficulty Examples {#intermediate-difficulty-examples}
### Media Controls & Screen Brightness {#media-controls-amp-screen-brightness} ### Media Controls & Screen Brightness {#media-controls-amp-screen-brightness}