Browse Source

[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>
Peter Cock 5 months ago
parent
commit
01e30d407c
1 changed files with 11 additions and 0 deletions
  1. 11 0
      docs/features/key_overrides.md

+ 11 - 0
docs/features/key_overrides.md

@@ -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}
 
 ### Media Controls & Screen Brightness {#media-controls-amp-screen-brightness}