kanata.kbd 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. grv 1 2 3 4 5 6 7 8 9 0 - = bspc
  13. tab q w e r t y u i o p [ ] \
  14. caps a s d f g h j k l ; ' ret
  15. lsft z x c v b n m , . / rsft
  16. fn lctl lalt lmet spc rmet ralt left down up rght
  17. )
  18. (defvar
  19. ;; Timing values - adjust based on your typing speed
  20. tap-time 200
  21. hold-time 150
  22. ;; Define which keys are on each hand for bilateral combinations
  23. left-hand-keys (q w e r t a s d f g z x c v b)
  24. right-hand-keys (y u i o p h j k l ; n m , . /)
  25. )
  26. ;; Base layer with home row modifiers and proper media keys
  27. (deflayer base
  28. esc brdn brup mctl @spotlight f5 f6 prev pp next mute vold volu
  29. grv 1 2 3 4 5 6 7 8 9 0 - = bspc
  30. tab q w e r t y u i o p [ ] \
  31. caps @a @s @d @f g h @j @k @l @; ' ret
  32. lsft z x c v b n m , . / rsft
  33. fn lctl lalt lmet spc rmet ralt left down up rght
  34. )
  35. ;; Layer without modifiers - used temporarily when tapping home row keys
  36. (deflayer nomods
  37. esc brdn brup mctl @spotlight f5 f6 prev pp next mute vold volu
  38. grv 1 2 3 4 5 6 7 8 9 0 - = bspc
  39. tab q w e r t y u i o p [ ] \
  40. caps a s d f g h j k l ; ' ret
  41. lsft z x c v b n m , . / rsft
  42. fn lctl lalt lmet spc rmet ralt left down up rght
  43. )
  44. (deffakekeys
  45. to-base (layer-switch base)
  46. )
  47. (defalias
  48. spotlight (multi lmet spc) ;; Command + Space
  49. ;; Tap behavior: switch to nomods layer temporarily, then back to base
  50. tap (multi
  51. (layer-switch nomods)
  52. (on-idle-fakekey to-base tap 20)
  53. )
  54. ;; Home row modifiers with bilateral combinations
  55. ;; Left hand keys with LEFT-side modifiers
  56. a (tap-hold-release-keys $tap-time $hold-time (multi a @tap) lctl $right-hand-keys)
  57. s (tap-hold-release-keys $tap-time $hold-time (multi s @tap) lalt $right-hand-keys)
  58. d (tap-hold-release-keys $tap-time $hold-time (multi d @tap) lmet $right-hand-keys)
  59. f (tap-hold-release-keys $tap-time $hold-time (multi f @tap) lsft $right-hand-keys)
  60. ;; Right hand keys with RIGHT-side modifiers
  61. j (tap-hold-release-keys $tap-time $hold-time (multi j @tap) rsft $left-hand-keys)
  62. k (tap-hold-release-keys $tap-time $hold-time (multi k @tap) rmet $left-hand-keys)
  63. l (tap-hold-release-keys $tap-time $hold-time (multi l @tap) ralt $left-hand-keys)
  64. ; (tap-hold-release-keys $tap-time $hold-time (multi ; @tap) rctl $left-hand-keys)
  65. )