.dotfiles/.config/kanata/kanata.kbd
2026-03-05 23:12:46 +02:00

122 lines
3.1 KiB
Text

#|
This minimal config changes Caps Lock to act as Caps Lock on quick tap, but
if held, it will act as Left Ctrl. It also changes the backtick/grave key to
act as backtick/grave on quick tap, but change ijkl keys to arrow keys on hold.
This text between the two pipe+octothorpe sequences is a multi-line comment.
|#
;; Text after double-semicolons are single-line comments.
#|
One defcfg entry may be added, which is used for configuration key-pairs. These
configurations change kanata's behaviour at a more global level than the other
configuration entries.
|#
(defcfg
#|
This configuration will process all keys pressed inside of kanata, even if
they are not mapped in defsrc. This is so that certain actions can activate
at the right time for certain input sequences. By default, unmapped keys are
not processed through kanata due to a Windows issue related to AltGr. If you
use AltGr in your keyboard, you will likely want to follow the simple.kbd
file while unmapping lctl and ralt from defsrc.
|#
process-unmapped-keys yes
linux-device-detect-mode keyboard-only
linux-dev /dev/input/event3
linux-dev-names-include ("AT Translated Set 2 keyboard")
concurrent-tap-hold yes
)
(defvar
tap-repress-timeout 200
hold-timeout 200
ht $hold-timeout
tt $tap-repress-timeout
)
(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 rctl
)
(defalias
;; home row mods
a (tap-hold-press $tt $ht a lalt )
s (tap-hold-press $tt $ht s lmet )
d (tap-hold-press $tt $ht d lctl )
f (tap-hold-press $tt $ht f lsft )
; (tap-hold-press $tt $ht ; lalt )
l (tap-hold-press $tt $ht l lmet )
k (tap-hold-press $tt $ht k lctl )
j (tap-hold-press $tt $ht j lsft )
spc (tap-hold-press $tt $ht spc (layer-toggle syms))
ralt (tap-hold-press $tt $ht bspc (layer-toggle navig))
_ S-min
dq (unicode r#"""#)
! S-1
@ S-2
# S-3
$ S-4
% S-5
& S-7
* S-8
lp S-9
rp S-0
? S-/
< S-,
> S-.
: S-;
| S-\
{ S-[
} S-]
~ S-`
)
(deflayermap (base)
a @a
s @s
d @d
f @f
; @;
l @l
k @k
j @j
lalt ret
spc @spc
ralt @ralt
)
(defchordsv2
(d k) esc 50 all-released ()
)
(deflayer syms
_ _ _ _ _ _ _ _ _ _ _ _ _ _
@~ @! @@ @# @$ @% 7 8 9 - = / _
` @? @< @> @lp @rp 4 5 6 + @: @dq _ _
_ @& @_ @{ @} [ ] 1 2 3 @* / @|
_ _ _ _ esc 0
)
(deflayer navig
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ up _ _ _ _
_ _ _ _ _ _ _ left down right _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
)