Skip to content

Instantly share code, notes, and snippets.

@honboubao
Created August 12, 2024 15:54
Show Gist options
  • Save honboubao/48ef5fb94ae4ec278026dcbc9f44fd83 to your computer and use it in GitHub Desktop.
Save honboubao/48ef5fb94ae4ec278026dcbc9f44fd83 to your computer and use it in GitHub Desktop.
Kanata (https://github.com/jtroo/kanata) keyboard mapping configuration. Adapted variant of the micro_qwertz keyboard layout (http://www.keyboard-layout-editor.com/#/gists/12281aabe024b50dbcfd42017a9aa722).
;; use with kanata_winIOv2.exe or kanata_gui.exe
(defcfg
windows-altgr cancel-lctl-press
process-unmapped-keys yes
)
(defvar
tap-time 200
)
#|
Keycodes
192 49 50 51 52 53 54 55 56 57 48 189 187 8
9 81 87 69 82 84 89 85 73 79 80 219 221
20 65 83 68 70 71 72 74 75 76 186 222 220 13
160 226 90 88 67 86 66 78 77 188 190 191 161
ISO UK
` 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
|#
(deflocalkeys-win
^ 192
ß 189
´ 187
ü 219
+ 221
ö 186
ä 222
# 220
< 226
z 89
y 90
- 191
)
(defalias
nav (layer-toggle nav)
sym (layer-toggle sym)
num (layer-toggle num)
spcnav (tap-hold-release $tap-time $tap-time spc @nav)
ctz C-z
ctx C-x
ctc C-c
ctv C-v
° S-^
! S-1
dqu S-2
§ S-3
$ S-4
% S-5
& S-6
/ S-7
pl S-8
pr S-9
= S-0
? S-ß
` S-´
* S-+
' S-#
> S-<
; S-,
: S-.
_ S--
² RA-2
³ RA-3
{ RA-7
[ RA-8
] RA-9
} RA-0
\ RA-ß
@ RA-q
€ RA-e
~ RA-+
| RA-<
µ RA-m
)
(deftemplate r3 (caps a s d f g h j k l ö ä # ret)
$caps
(tap-hold-release $tap-time $tap-time $a lsft)
(tap-hold-release $tap-time $tap-time $s @sym)
(tap-hold-release $tap-time $tap-time $d @num)
$f $g $h $j
(tap-hold-release $tap-time $tap-time $k @num)
(tap-hold-release $tap-time $tap-time $l @sym)
(tap-hold-release $tap-time $tap-time $ö rsft)
$ä $# $ret
)
(deftemplate r4 (lsft < y x c v b n m , . - rsft)
$lsft
(tap-hold-release $tap-time $tap-time $< lctl)
(tap-hold-release $tap-time $tap-time $y lctl)
(tap-hold-release $tap-time $tap-time $x lalt)
(tap-hold-release $tap-time $tap-time $c lalt)
$v $b $n $m
(tap-hold-release $tap-time $tap-time $, lalt)
(tap-hold-release $tap-time $tap-time $. lalt)
(tap-hold-release $tap-time $tap-time $- rctl)
$rsft
)
(defsrc
^ 1 2 3 4 5 6 7 8 9 0 ß ´ bspc
tab q w e r t z u i o p ü +
caps a s d f g h j k l ö ä # ret
lsft < y x c v b n m , . - rsft
lctl lmet lalt spc ralt rmet rctl
)
(deflayer base
^ 1 2 3 4 5 6 7 8 9 0 ß ´ bspc
tab q w e r t z u i o p ü +
(t! r3 caps a s d f g h j k l ö ä # ret)
(t! r4 lsft < y x c v b n m , . - rsft)
lctl lmet lalt @spcnav ralt rmet rctl
)
(deflayer nav
XX _ _ _ _ _ _ _ _ _ _ XX XX _
_ XX home up end @ctz pgup home up end bspc del XX
(t! r3 _ lsft left down right ret pgdn left down right ret XX XX _)
(t! r4 _ esc esc tab bspc del mfwd mbck @ctx @ctc @ctv esc _)
_ _ _ _ _ _ _
)
(deflayer sym
XX _ _ _ _ _ _ _ _ _ _ XX XX _
_ ^ @$ # @% @& @| @{ @} @[ @] XX XX
(t! r3 _ @@ @` @' @dqu @? @! @pl @pr < @> XX XX _)
(t! r4 _ XX @\ @/ @* + - @= @; , @: @_ _)
_ _ _ _ _ _ _
)
(deflayer num
XX _ _ _ _ _ _ _ _ _ _ XX XX _
_ @° @§ @² @³ XX @: 7 8 9 bspc del XX
(t! r3 _ @€ ´ @µ spc XX , 4 5 6 ret XX XX _)
(t! r4 _ XX @~ XX XX XX . 0 1 2 3 - _)
_ _ _ _ _ _ _
)
#|
(deflayer empty
XX _ _ _ _ _ _ _ _ _ _ XX XX _
_ _ _ _ _ _ _ _ _ _ _ XX XX
(t! r3 _ _ _ _ _ _ _ _ _ _ _ XX XX _)
(t! r4 _ XX _ _ _ _ _ _ _ _ _ _ _)
_ _ _ _ _ _ _
)
|#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment