1
0
Prechádzať zdrojové kódy

feat(kanata): implement symbol and number layers

This commit refactors the kanata configuration to use a more modal approach with dedicated layers for symbols and numbers. This change mimics my personal ZSA Voyager keyboard configuration to unify my workflow across different machines.

The `symbols` layer is activated by holding the left meta key, and the `numbers` layer is toggled with the 'v' key. The base layer has been simplified to accommodate these new layers, and the `hold-time` for tap-hold actions has been increased to 200ms to prevent accidental triggers.
Zander Hawke 10 mesiacov pred
rodič
commit
53d6c256dd
1 zmenil súbory, kde vykonal 51 pridanie a 27 odobranie
  1. 51 27
      hosts/meili/kanata.kbd

+ 51 - 27
hosts/meili/kanata.kbd

@@ -10,48 +10,69 @@
 )
 
 (defsrc
-  esc  f1   f2   f3   f4   f5   f6   f7   f8   f9   f10  f11  f12
-  grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc
-  tab  q    w    e    r    t    y    u    i    o    p    [    ]    \
-  caps a    s    d    f    g    h    j    k    l    ;    '    ret
-  lsft z    x    c    v    b    n    m    ,    .    /    rsft
-  fn   lctl lalt lmet           spc           rmet ralt left down up   rght
+  ;; esc  f1   f2   f3   f4   f5   f6   f7   f8   f9   f10  f11  f12
+       f1   f2                                      f10  f11  f12
+  ;; grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc
+  ;; tab  q    w    e    r    t    y    u    i    o    p    [    ]    \
+       q    w    e    r    t    y    u    i    o    p
+  ;; caps a    s    d    f    g    h    j    k    l    ;    '    ret
+       a    s    d    f    g    h    j    k    l    ;
+  ;; lsft z    x    c    v    b    n    m    ,    .    /    rsft
+       z    x    c    v    b    n    m    ,    .    /
+  ;; fn   lctl lalt lmet           spc           rmet ralt left down up   rght
+                 lmet           spc           rmet
 )
 
-(defvar
-  ;; Timing values - adjust based on your typing speed
-  tap-time 200
-  hold-time 150
+;; Base layer with home row modifiers and proper media keys
+(deflayer base
+       brdn brup                                         mute vold volu
+       q    w    e    r    t    y    u    i    o    p
+       @a   @s   @d   @f   g    h    @j   @k   @l   @;
+       z    x    c    @v   b    n    m    ,    .    /
+                 @lmet          spc           ret
+)
 
-  ;; Define which keys are on each hand for bilateral combinations
-  left-hand-keys (q w e r t a s d f g z x c v b)
-  right-hand-keys (y u i o p h j k l ; n m , . /)
+;; Symbols layer
+(deflayer symbols
+       brdn brup                                         mute vold volu
+       S-1  S-2  S-3  S-4  S-5  S-6  S-7  S-[  S-]  S-8
+       `    S--  -    S-=  =    S-`  S-\  S-9  S-0  '
+       z    x    c    tab  b    /    \    [    ]    S-/
+                 lmet           spc           ret
 )
 
-;; Base layer with home row modifiers and proper media keys
-(deflayer base
-  esc  brdn brup mctl @spotlight f5 f6 prev pp   next mute vold volu
-  grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc
-  tab  q    w    e    r    t    y    u    i    o    p    [    ]    \
-  caps @a   @s   @d   @f   g    h    @j   @k   @l   @;   '    ret
-  lsft z    x    c    v    b    n    m    ,    .    /    rsft
-  fn   lctl lalt lmet           spc           rmet ralt left down up   rght
+;; Numpad layer
+(deflayer numbers
+       brdn brup                                         mute vold volu
+       q    w    e    r    t    S-8  7    8    9    -
+       @a   @s   ,    .    g    /    4    5    6    S-=
+       z    x    c    v    b    =    1    2    3    ret
+                 lmet           spc           0
 )
 
 ;; Layer without modifiers - used temporarily when tapping home row keys
 (deflayer nomods
-  esc  brdn brup mctl @spotlight f5 f6 prev pp   next mute vold volu
-  grv  1    2    3    4    5    6    7    8    9    0    -    =    bspc
-  tab  q    w    e    r    t    y    u    i    o    p    [    ]    \
-  caps a    s    d    f    g    h    j    k    l    ;    '    ret
-  lsft z    x    c    v    b    n    m    ,    .    /    rsft
-  fn   lctl lalt lmet           spc           rmet ralt left down up   rght
+       brdn brup                                         mute vold volu
+       q    w    e    r    t    y    u    i    o    p
+       a    s    d    f    g    h    j    k    l    ;
+       z    x    c    v    b    n    m    ,    .    /
+                 lmet           spc           ret
 )
 
 (deffakekeys
   to-base (layer-switch base)
 )
 
+(defvar
+  ;; Timing values - adjust based on your typing speed
+  tap-time 175
+  hold-time 200
+
+  ;; Define which keys are on each hand for bilateral combinations
+  left-hand-keys (q w e r t a s d f g z x c v b)
+  right-hand-keys (y u i o p h j k l ; n m , . /)
+)
+
 (defalias
   spotlight (multi lmet spc)  ;; Command + Space
   ;; Tap behavior: switch to nomods layer temporarily, then back to base
@@ -72,4 +93,7 @@
   k (tap-hold-release-keys $tap-time $hold-time (multi k @tap) rmet $left-hand-keys)
   l (tap-hold-release-keys $tap-time $hold-time (multi l @tap) ralt $left-hand-keys)
   ; (tap-hold-release-keys $tap-time $hold-time (multi ; @tap) rctl $left-hand-keys)
+
+  v (tap-hold $tap-time $hold-time (multi v @tap) (layer-toggle numbers))
+  lmet (layer-toggle symbols)
 )