summaryrefslogtreecommitdiff
path: root/desktop/.config/kanata/kanata.kbd
blob: 703e3b7cc248904c110813212e8c49a7f933c8c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
;; Kanata Configuration File for Graphite Anglemod Layout

;; Add a default configuration section to define unmapped key behavior.
(defcfg
 process-unmapped-keys yes
)

;; Define the source keys Kanata will intercept.
(defsrc
 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
 lctl lmet lalt           spc            ralt rmet rctl
)

;; Default QWERTY Layout
(deflayer qwerty
 @grl 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
 lctl lmet lalt           spc            ralt rmet rctl
)

(deftemplate charmod (char mod)
  (switch
    ((key-timing 3 less-than 250)) $char break
    () (tap-hold-release-timeout 200 500 $char $mod $char) break
  )
)

(defalias
  quote  (fork ' S-- (lsft rsft)) ;; ' -> _
  comma  (fork , S-/ (lsft rsft)) ;; , -> ?
  hyphen (fork - S-' (lsft rsft)) ;; - -> "
  slash  (fork / S-, (lsft rsft)) ;; / -> <

  n (t! charmod n lmet)
  r (t! charmod r lalt)
  t (t! charmod t lctl)
  s (t! charmod s lsft)

  h (t! charmod h lsft)
  a (t! charmod a lctl)
  e (t! charmod e lalt)
  i (t! charmod i lmet)

  ;; Tap: backtick (grave), Hold: toggles 'layers' for layer switching.
  grl (tap-hold 200 200 grv (layer-toggle layers))

  ;; Layer-switch aliases
  gar (layer-switch graphite)
  qwr (layer-switch qwerty)

  ;; Tap for Caps Lock, Hold for Ctrl
  cap (tap-hold 200 200 caps lctl)
)

(deflayer graphite
 @grl 1    2    3    4    5    6      7    8    9       0      [      ]    bspc
 tab  b    l    d    w    z    @quote f    o    u       j      ;      =    \
 lctl @n   @r   @t   @s   g    y      @h   @a   @e      @i     @comma ret
 lsft q    x    m    c    v    k      p    .    @hyphen @slash rsft
 lctl lmet lalt           spc             ralt rmet rctl
)

;; Keys 1 and 2 switch between QWERTY and Graphite
;; The _ (underscore) indicates transparent behavior (passes through base layer).
(deflayer layers
 _    @qwr @gar _    _    _    _    _    _    _    lrld    _    _   _
 _    _    _    _    _    _    _    _    _    _    _    _    _   _
 _    _    _    _    _    _    _    _    _    _    _    _    _
 _    _    _    _    _    _    _    _    _    _    _    _
 _    _    _              _              _    _    _
)