kanata.kbd 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. ;; Kanata configuration for MacBook Air M2 with advanced home row modifiers
  2. ;; Uses tap-hold-release-keys with bilateral combinations for better accuracy
  3. (defcfg
  4. process-unmapped-keys yes
  5. ;; Adjust these paths based on your system
  6. ;; macOS typically uses something like this:
  7. ;; linux-dev /dev/input/by-path/your-keyboard-path
  8. ;; For macOS, you might need to specify the input device differently
  9. )
  10. (defsrc
  11. ;; esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
  12. f1 f2 f10 f11 f12
  13. ;; grv 1 2 3 4 5 6 7 8 9 0 - = bspc
  14. ;; tab q w e r t y u i o p [ ] \
  15. q w e r t y u i o p
  16. ;; caps a s d f g h j k l ; ' ret
  17. a s d f g h j k l ;
  18. ;; lsft z x c v b n m , . / rsft
  19. z x c v b n m , . /
  20. ;; fn lctl lalt lmet spc rmet ralt left down up rght
  21. lmet spc rmet
  22. )
  23. ;; Base layer with home row modifiers and proper media keys
  24. (deflayer base
  25. brdn brup mute vold volu
  26. q w e r t y u i o p
  27. @a @s @d @f g h @j @k @l @;
  28. z x c @v b n m , . /
  29. @lmet spc ret
  30. )
  31. ;; Symbols layer
  32. (deflayer symbols
  33. brdn brup mute vold volu
  34. S-1 S-2 S-3 S-4 S-5 S-6 S-7 S-[ S-] S-8
  35. ` S-- - S-= = S-` S-\ S-9 S-0 '
  36. z x c tab b / \ [ ] S-/
  37. lmet spc ret
  38. )
  39. ;; Numpad layer
  40. (deflayer numbers
  41. brdn brup mute vold volu
  42. q w e r t S-8 7 8 9 -
  43. @a @s , . g / 4 5 6 S-=
  44. z x c v b = 1 2 3 ret
  45. lmet spc 0
  46. )
  47. ;; Layer without modifiers - used temporarily when tapping home row keys
  48. (deflayer nomods
  49. brdn brup mute vold volu
  50. q w e r t y u i o p
  51. a s d f g h j k l ;
  52. z x c v b n m , . /
  53. lmet spc ret
  54. )
  55. (deffakekeys
  56. to-base (layer-switch base)
  57. )
  58. (defvar
  59. ;; Timing values - adjust based on your typing speed
  60. tap-time 175
  61. hold-time 200
  62. ;; Define which keys are on each hand for bilateral combinations
  63. left-hand-keys (q w e r t a s d f g z x c v b)
  64. right-hand-keys (y u i o p h j k l ; n m , . /)
  65. )
  66. (defalias
  67. spotlight (multi lmet spc) ;; Command + Space
  68. ;; Tap behavior: switch to nomods layer temporarily, then back to base
  69. tap (multi
  70. (layer-switch nomods)
  71. (on-idle-fakekey to-base tap 20)
  72. )
  73. ;; Home row modifiers with bilateral combinations
  74. ;; Left hand keys with LEFT-side modifiers
  75. a (tap-hold-release-keys $tap-time $hold-time (multi a @tap) lctl $right-hand-keys)
  76. s (tap-hold-release-keys $tap-time $hold-time (multi s @tap) lalt $right-hand-keys)
  77. d (tap-hold-release-keys $tap-time $hold-time (multi d @tap) lmet $right-hand-keys)
  78. f (tap-hold-release-keys $tap-time $hold-time (multi f @tap) lsft $right-hand-keys)
  79. ;; Right hand keys with RIGHT-side modifiers
  80. j (tap-hold-release-keys $tap-time $hold-time (multi j @tap) rsft $left-hand-keys)
  81. k (tap-hold-release-keys $tap-time $hold-time (multi k @tap) rmet $left-hand-keys)
  82. l (tap-hold-release-keys $tap-time $hold-time (multi l @tap) ralt $left-hand-keys)
  83. ; (tap-hold-release-keys $tap-time $hold-time (multi ; @tap) rctl $left-hand-keys)
  84. v (tap-hold $tap-time $hold-time (multi v @tap) (layer-toggle numbers))
  85. lmet (layer-toggle symbols)
  86. )