1
0

kanata.kbd 3.9 KB

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