Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.org

Config file for kanata

Table of Contents

Initial config

(defcfg

Input

native

linux-dev "/dev/input/by-path/platform-i8042-serio-0-event-kbd"

using udev/hwdb

linux-dev "/dev/input/by-path/platform-i8042-serio-0-event"

Output

;;output (uinput-sink "kanata INKL output")

Other settings

  • process-unmapped-keys: if yes, process keys not defined in defsrc
  • danger-enable-cmd: enable command-execution
  • linux-output-device-bus-type: bus type for output device
  • log-layer-changes: enable/disable layer changes logging
  • movemouse-inherit-accel-state: use same mouse acceleration for vertical/horizontal (like in QMK)
process-unmapped-keys yes
danger-enable-cmd yes
linux-output-device-bus-type USB
log-layer-changes no
;;movemouse-inherit-accel-state yes

EoS

)

Variables

(defvar
  st 110  ;; shift timeout
  mt 150  ;; other modifiers timeout
  rt 250  ;; repeat tap window
)

Layers

template

original

(deflayer template
  '    1     2     3     4     5     6     7     8     9     0     -    =        bspc        nlck kp/  kp*  kp-
  tab     q     w     e     r     t     y     u     i     o     p     '    [     ret         kp7  kp8  kp9  kp+
  caps      a     s     d     f     g     h     j     k     l     ç     ~    ]               kp4  kp5  kp6
  lsft  \\    z     x     c     v     b     n     m     ,     .     ;            rsft        kp1  kp2  kp3  kprt
  lctl              lmet  lalt            spc           ralt  /     left   up    rght        kp0     kp.
                                                                           down
)

after udev/hwdb

(deflayer template
  XX   XX    q     w     e     r     t     XX    y     u     i     o    p        bspc        nlck /    *    -
  XX      a     s     d     f     g     XX    XX    h     j     k     l    F13   ret         4    5    6    +
  z         x     c     v     b     XX    XX    XX    n     m     ,     .    /               1    2    3
  lsft  XX    XX    tl1   tl2   tl3   XX    XX    XX    tr1   tr2   XX           rsft        7    8    9    kprt
  lctl              lmet  lalt            spc           ralt  /     left   up    rght        0       kp.
                                                                           down
)

empty

(deflayer empty
  XX XX  q    w    e    r    t      XX      y    u    i    o    p       bspc        nlck kp/  kp*  kp-
  XX    a    s    d    f    g     XX  XX     h    j    k    l    ç      ret         kp7  kp8  kp9  kp+
       z    x    c    v    b    XX  XX  XX    n    m    ,    .    ;                 kp4  kp5  kp6
  XX   XX   XX   tl1  tl2  tl3   XX  XX  XX    tr1  tr2  XX             rsft        kp1  kp2  kp3  kprt
  XX        XX   XX             spc            XX   XX   left     up    rght        kp0       kp.
                                                                        down
)

split

(deflayer split
  _    _    _    _    _         _    _    _    _    _         _  _  _
  _    _    _    _    _         _    _    _    _    _         _  _  _
  _    _    _    _    _         _    _    _    _    _         _  _  _
            _    _    _         _    _    _                   _  _  _
                                                              _  _  _
)

split left

(deflayer left
  _    _    _    _    _         XX   XX   XX   XX   XX        _  _  _
  _    _    _    _    _         @hra @hs  @hc  @hsm @hm       _  _  _
  _    _    _    _    _         XX   XX   XX   XX   XX        _  _  _
            _    _    _         _    _    _                   _  _  _
                                                              _  _  _
)

split right

(deflayer right
  XX   XX   XX   XX   XX        _    _    _    _    _         _  _  _
  @hm  @ha  @hc  @hs  @hra      _    _    _    _    _         _  _  _
  XX   XX   XX   XX   XX        _    _    _    _    _         _  _  _
            _    _    _         _    _    _                   _  _  _
                                                              _  _  _
)

base (us)

original

(defsrc
  2    3    4    5    6         7    8    9    0    -               kp/  kp*  kp-
  q    w    e    r    t         u    i    o    p    [               kp7  kp8  kp9
  caps a    s    d    f         j    k    l    ;    '               kp4  kp5  kp6
            x    c    v         n    m     ,                        kp1  kp2  kp3
                                                                    kp0  kp.  kp+
)

mod (qwerty)

(defsrc
  q    w    e    r    t         y    u    i    o    p               kp/  kp*  kp-
  a    s    d    f    g         h    j    k    l    ;               4    5    6
  z    x    c    v    b         n    m    ,    .    /               1    2    3
            esc  spc  tab       -    ret  bspc                      7    8    9
                                                                    0    kp.  kp+
)

mod (colemak)

(defsrc
  q    w    f    p    b         j    l    u    y    ;               kp/  kp*  kp-
  a    r    s    t    g         m    n    e    i    o               4    5    6
  z    x    c    d    v         k    h    ,    .    /               1    2    3
            esc  spc  tab       -    ret  bspc                      7    8    9
                                                                    0    kp.  kp+
)

alias

hold

(defalias
  hm  (tap-hold-release $mt $mt XX   lmet)    ;; hold meta_l
  ha  (tap-hold-release $mt $mt XX   lalt)    ;; hold alt_l
  hc  (tap-hold-release $mt $mt XX   lctl)    ;; hold ctrl_l
  hs  (tap-hold-release $st $st XX   lsft)    ;; hold shift_l
  hra (tap-hold-release $mt $mt XX   ralt)    ;; hold alt_r
  hsm (tap-hold-release $mt $mt XX   S-lmet)  ;; hold shift_l-meta_l
)

other

(defalias
  s2m (tap-hold-release $mt $mt spc  lmet)  ;; space to meta_L
  c2e (tap-hold-release $mt $mt esc  lctl)  ;; esc to ctrl_L (caps2esc)
)

layers

(defalias
  ;; thumbs
  nav (tap-hold-release $mt $mt esc  (layer-toggle navigation))
  num (tap-hold-release $mt $mt ret  (layer-toggle number))
  sym (tap-hold-release $mt $mt bspc (layer-toggle symbol))
  wm  (tap-hold-release $mt $mt spc  (layer-toggle window-manager))
  mou (tap-hold-release $mt $mt tab  (layer-toggle mouse))

  ;; colemak-dh
  msc (tap-hold-release $mt $mt w (layer-toggle misc))
  med (tap-hold-release $mt $mt f (layer-toggle media))
  lum (tap-hold-release $mt $mt z (layer-toggle luminosity))
  yts (tap-hold-release $mt $mt y (layer-toggle youtube-speed))
  fn1 (tap-hold-release $mt $mt j (layer-toggle function-keys-1))
  fn2 (tap-hold-release $mt $mt b (layer-toggle function-keys-2))

  ;; qwerty
  qmd (tap-hold-release $mt $mt e (layer-toggle media))
  qlm (tap-hold-release $mt $mt z (layer-toggle luminosity))
  qf1 (tap-hold-release $mt $mt y (layer-toggle function-keys-1))
  qf2 (tap-hold-release $mt $mt t (layer-toggle function-keys-2))
)

qwerty

(deflayer qwerty
  q    w    @qmd r    @qf2      @qf1 u    i    o    p         /  *  -
  @mqa @mqs @mqd @mqf @mqg      @mqh @mqj @mqk @mql @mq;      7  8  9
  @qlm x    c    v    b         n    m    ,    .    /         4  5  6
            @nav @wm  @mou      XX   @num @sym                1  2  3
                                                              0  .  +
)

alias

left hand

(defalias
  ;; miryoku qwerty
  mqa (tap-hold-release $mt $mt a lmet)  ;; a to meta_L
  mqs (tap-hold-release $mt $mt s lalt)  ;; s to alt_L
  mqd (tap-hold-release $mt $mt d lctl)  ;; d to ctrl_L
  mqf (tap-hold-release $st $st f lsft)  ;; f to shift_L
  mqg (tap-hold-release $mt $mt g ralt)  ;; g to alt_R
)

right hand

(defalias
  ;; miryoku qwerty
  mqh (tap-hold-release $mt $mt h    ralt)    ;; h to alt_R
  mqj (tap-hold-release $st $st j    lsft)    ;; j to shift_L
  mqk (tap-hold-release $mt $mt k    lctl)    ;; k to ctrl_R
  mql (tap-hold-release $mt $mt l    S-lmet)  ;; l to shift_L-meta_L
  mq; (tap-hold-release $mt $mt f13  lmet)    ;; semicolon to meta_L
)

colemak-dh

(deflayer colemak
  q    @msc @med p    @fn2      @fn1 l    u    @yts f13       _  _  _
  @mka @mkr @mks @mkt @mkg      @mkm @mkn @mke @mki @mko      _  _  _
  @lum x    c    d    v         k    h    ,    .    /         _  _  _
            @nav @wm  @mou      XX   @num @sym                _  _  _
                                                              _  _  _
)

alias

left hand

(defalias
  ;; miryoku colemak-dh
  mka (tap-hold-release $mt $mt a lmet)  ;; a to meta_L
  mkr (tap-hold-release $mt $mt r lalt)  ;; r to alt_L
  mks (tap-hold-release $mt $mt s lctl)  ;; s to ctrl_L
  mkt (tap-hold-release $st $st t lsft)  ;; t to shift_L
  mkg (tap-hold-release $mt $mt g ralt)  ;; g to alt_R
)

right hand

(defalias
  ;; miryoku colemak-dh
  mkm (tap-hold-release $rt $mt m (layer-toggle out3))
  mkn (tap-hold-release $rt $st n lsft)   ;; n to shift_L
  mke (tap-hold-release $rt $mt e lctl)   ;; e to ctrl_R
  mki (tap-hold-release $rt $mt i (layer-toggle out2))
  mko (tap-hold-release $rt $mt o (layer-toggle out1))
)

number

(deflayer number
  [    4    5    6    ]         @sps @vp1 @vp2 @vp3 @vp4      _  _  _
  @:   1    2    3    -         @mo3 @spt @spp @mo2 @mo1      _  _  _
  @~   7    8    9    +         XX   spc  ,    .    /         _  _  _
            @t2n 0    =         _    _    _                   _  _  _
                                                              _  _  _
)

alias

(defalias
  t2n (tap-hold-release $mt $mt tab (layer-toggle navigation))  ;; tab to nav layer
  : S-;  ;; colon
  ~ S-grave
  ;;!!! FIX ME !!!
  mo1 (tap-hold-release $mt $mt XX (multi lctl lmet))       ;; move container to ws 0~9
  mo2 (tap-hold-release $mt $mt XX (multi lctl lsft lmet))  ;; move container to ws 10~19
  mo3 (tap-hold-release $mt $mt XX (multi lctl ralt))       ;; move container to ws 20~29
  ;;!!! FIX ME !!!

  ;; scratchpads
  spt (tap-hold-release $mt $mt M-n rsft)  ;; terminal
  spp (tap-hold-release $mt $mt M-e rctl)  ;; python
  sps M-i    ;; scratchpad scrcpy

  ;; VPNs
  vp1 M-A-1  ;; connect to VPN #1: La Casa Nostra
  vp2 M-A-2  ;; connect to VPN #2: Unicamp
  vp3 M-A-3  ;; connect to VPN #3: LBiC
  vp4 M-A-4  ;; connect to VPN #4: Samsung
)

symbol

(deflayer symbol
  @{   @$   @%   @^   @}        @emo @{   vold volu @}        _  _  _
  ;    @!   @@   @#   @_        @hpa @hal @had @hau @har      _  _  _
  grv  @&   @*   @lp  \         spc  @wsp @btp @btn @wsn      _  _  _
            _    @rp  @|        _    XX   XX                  _  _  _
                                                              _  _  _
)

alias

(defalias
  ;; shifted numbers
  !   S-1    ;; exclamation
  @   S-2    ;; at sign
  #   S-3    ;; hash (number sign)
  $   S-4    ;; dollar
  %   S-5    ;; percent
  ^   S-6    ;; caret (circumflex)
  &   S-7    ;; ampersand
  *  S-8    ;; asterisk
  lp  S-9    ;; left  parenthesis
  rp  S-0    ;; right parenthesis

  ;; misc
  {  S-[     ;; left  curly bracket
  }  S-]     ;; right curly bracket
  _   S--    ;; underscore
  |   S-\    ;; vertical bar
  emo A-C-e  ;; launch Emote emoji picker

  ;; one-hand media control
  hpa (tap-hold-release $mt $mt pp ralt)    ;; hold for alt_r / song play/pause
  
  ;; one-hand arrows
  hal (tap-hold-release $mt $mt left lsft)  ;; hold for mod / arrow left
  had (tap-hold-release $mt $mt down rctl)  ;; hold for mod / arrow down
  hau (tap-hold-release $mt $mt up   lalt)  ;; hold for mod / arrow up
  har (tap-hold-release $mt $mt rght lmet)  ;; hold for mod / arrow right
  
  ;; one-hand navigation
  btn C-tab    ;; browser tab previous
  btp S-C-tab  ;; browser tab next
  ;;wsn S-RM-down   ;; focus workspace next --> already defined in window-manager layer
  ;;wsp S-RM-up     ;; focus workspace previous --> already defined in window-manager layer
)

OBS

obs

(deflayer obs
  @op1 @sc4 @sc5 @sc6 @rcd      XX   XX   XX   XX   XX        _  _  _
  @op0 @sc1 @sc2 @sc3 -         @hra @hs  @hc  @hsm @hm       _  _  _
  @op2 @sc7 @sc8 @sc9 +         XX   XX   XX   XX   XX        _  _  _
            up   down @onl      _    _    _                   _  _  _
                                                              _  _  _
)

obs numbers

(deflayer obs-num
  esc  4    5    6    XX        XX   XX   XX   XX   XX        _  _  _
  tab  1    2    3    -         @hra @hs  @hc  @hsm @hm       _  _  _
  z    7    8    9    +         XX   XX   XX   XX   XX        _  _  _
            @clk 0    _         _    _    _                   _  _  _
                                                              _  _  _
)

alias

(defalias
  ;; outputs
  op0 S-A-f10  ;; OBS switch to output-0
  op1 S-A-f11  ;; OBS switch to output-1
  op2 S-A-f12  ;; OBS switch to output-2

  ;; scenes
  sc1 S-A-f1   ;; OBS switch to scene-1
  sc2 S-A-f2   ;; OBS switch to scene-2
  sc3 S-A-f3   ;; OBS switch to scene-3
  sc4 S-A-f4   ;; OBS switch to scene-4
  sc5 S-A-f5   ;; OBS switch to scene-5
  sc6 S-A-f6   ;; OBS switch to scene-6
  sc7 S-A-f7   ;; OBS switch to scene-7
  sc8 S-A-f8   ;; OBS switch to scene-8
  sc9 S-A-f9   ;; OBS switch to scene-9

  bs  XX        ;; @TBD: black screen
  rcd S-A-f14   ;; OBS toggle recording

  ;; activate layer for OBS numbers
  onl (tap-hold-release $mt $mt XX (layer-toggle obs-num))
  ;; activate base layer (Colemak-DH)
  clk (layer-toggle colemak)
)

window manager

(deflayer window-manager
  @klw @klt @fsc @lck @flt      @pom @ofl @wsn @wsp @ofr      _  _  _
  @res @sag @spy @spw @ter      @lms @wfl @wfd @wfu @wfr      _  _  _
  @spl @emx @cpy @pst @pac      @spu @sp1 @sp2 @sp3 @spa      _  _  _
            _    XX   _         _    @rof @emc                _  _  _
                                                              _  _  _
)

alias

left hand

(defalias
  klw A-M-q     ;; kill window
  klt A-M-w     ;; kill tab
  fsc A-M-f     ;; fullscreen
  lck M-home    ;; i3/sway mode_system
  flt M-b       ;; i3/sway floating mode

  ;;e2m (tap-hold-release $mt $mt ret lmet)  ;; enter to left meta
  res (tap-hold-release $mt $mt M-a lmet)  ;; i3/sway resize container
  sag (tap-hold-release $mt $mt M-r lalt)  ;; scratchpad Agenda/Calendar
  spy (tap-hold-release $mt $mt M-s lctl)  ;; scratchpad YouTube Music
  spw (tap-hold-release $mt $mt M-t lsft)  ;; scratchpad WhatsApp
  ter (tap-hold-release $mt $mt A-M-g rmet)  ;; open terminal

  spl A-M-z  ;; i3/sway toggle horizontal/vertical orientation split
  emx A-f16  ;; Emacs M-x --> redirected with xremap
  cpy S-f16  ;; copy --> redirected with xremap
  pst C-f16  ;; paste --> redirected with xremap
  pac M-v    ;; pacman update (Arch Linux)
)

right hand

(defalias
  ofl S-RM-left   ;; focus output left
  wsn S-RM-down   ;; focus workspace next
  wsp S-RM-up     ;; focus workspace previous
  ofr S-RM-right  ;; focus output right

  wfl M-left   ;; focus window left
  wfd M-down   ;; focus window down
  wfu M-up     ;; focus window up
  wfr M-right  ;; focus window right

  sp1 M-h  ;; scratchpad temp #1
  sp2 M-,  ;; scratchpad temp #2
  sp3 M-.  ;; scratchpad temp #3

  spa M-/  ;; scratchpad agenda
  pom M-j  ;; pomodoro timer
  lms M-m  ;; lan-mouse switch
  spu M-k  ;; scratchpad Keymapp

  rof M-ret  ;; open rofi (application launcher)
  emc A-C-l  ;; launch emacsclient
)

navigation

(deflayer navigation
  XX   4    5    6    XX        @cw  @ps  home end  XX        _  _  _
  @mwp @hn1 @hn2 @hn3 @mwn      caps left down up   rght      _  _  _
  @obs 7    8    9    0         @key @pss pgdn pgup XX        _  _  _
            _    _    _         _    _    del                 _  _  _
                                                              _  _  _
)

alias

(defalias
  cw (caps-word 2000)  ;; Caps WORD
  ps  prnt             ;; PrintScreen
  pss S-prnt           ;; Shift-PrintScreen
  key A-C-k            ;; launch screenkey
  obs (tap-hold-release $mt $mt XX (layer-toggle obs))  ;; OBS recording layer

  ;; workspaces navigation
  mwp (tap-hold-release $mt $mt S-RM-up lmet)    ;; modifier + focus workspace previous
  mwn (tap-hold-release $mt $mt S-RM-down ralt)  ;; modifier + focus workspace next

  ;; one-hand numbers
  hn1  (tap-hold-release $mt $mt 1 lalt)  ;; hold for mod / tap for number 1
  hn2  (tap-hold-release $mt $mt 2 lctl)  ;; hold for mod / tap for number 2
  hn3  (tap-hold-release $mt $mt 3 lsft)  ;; hold for mod / tap for number 3
)

outputs

output 1

(deflayer out1
  XX   @w4  @w5  @w6  XX        XX   XX   XX   XX   XX        _  _  _
  XX   @w1  @w2  @w3  XX        XX   XX   XX   XX   XX        _  _  _
  XX   @w7  @w8  @w9  XX        XX   XX   XX   XX   XX        _  _  _
            _    @w0  _         _    lctl _                   _  _  _
                                                              _  _  _
)

output 2

(deflayer out2
  XX   @w14 @w15 @w16 XX        XX   XX   XX   XX   XX        _  _  _
  XX   @w11 @w12 @w13 XX        XX   XX   XX   XX   XX        _  _  _
  XX   @w17 @w18 @w19 XX        XX   XX   XX   XX   XX        _  _  _
            _    @w10 _         _    lctl _                   _  _  _
                                                              _  _  _
)

output 3

(deflayer out3
  XX   @w24 @w25 @w26 XX        XX   XX   XX   XX   XX        _  _  _
  XX   @w21 @w22 @w23 XX        XX   XX   XX   XX   XX        _  _  _
  XX   @w27 @w28 @w29 XX        XX   XX   XX   XX   XX        _  _  _
            _    @w20 _         _    lctl _                   _  _  _
                                                              _  _  _
)

alias

(defalias
  ;; output 1
  w0  M-0  ;; focus workspace 0
  w1  M-1  ;; focus workspace 1
  w2  M-2  ;; focus workspace 2
  w3  M-3  ;; focus workspace 3
  w4  M-4  ;; focus workspace 4
  w5  M-5  ;; focus workspace 5
  w6  M-6  ;; focus workspace 6
  w7  M-7  ;; focus workspace 7
  w8  M-8  ;; focus workspace 8
  w9  M-9  ;; focus workspace 9

  ;; output 2
  w10 S-M-0  ;; focus workspace 10
  w11 S-M-1  ;; focus workspace 11
  w12 S-M-2  ;; focus workspace 12
  w13 S-M-3  ;; focus workspace 13
  w14 S-M-4  ;; focus workspace 14
  w15 S-M-5  ;; focus workspace 15
  w16 S-M-6  ;; focus workspace 16
  w17 S-M-7  ;; focus workspace 17
  w18 S-M-8  ;; focus workspace 18
  w19 S-M-9  ;; focus workspace 19

  ;; output 3
  w20 RM-0  ;; focus workspace 20
  w21 RM-1  ;; focus workspace 21
  w22 RM-2  ;; focus workspace 22
  w23 RM-3  ;; focus workspace 23
  w24 RM-4  ;; focus workspace 24
  w25 RM-5  ;; focus workspace 25
  w26 RM-6  ;; focus workspace 26
  w27 RM-7  ;; focus workspace 27
  w28 RM-8  ;; focus workspace 28
  w29 RM-9  ;; focus workspace 29
)

media

(deflayer media
  XX   @vdc XX   @vuc XX        @mm  XX   @mdc @muc XX        _  _  _
  @hpp @hsp @hc  @hsn @hra      @pp  @sp  @vdc @vuc @sn       _  _  _
  XX   XX   XX   XX   XX        @vm  XX   @vdf @vuf XX        _  _  _
            @v00 @v25 @v50      _    @v75 @v99                _  _  _
                                                              _  _  _
)

alias

(defalias
  vdc vold     ;; volume down (coarse)
  vuc volu     ;; volume up (coarse)
  vm  mute     ;; mute volume
  vdf (multi f15 , reverse-release-order)  ;; volume down (fine)
  vuf (multi f15 . reverse-release-order)  ;; volume up (fine)

  mdc (multi f15 u   reverse-release-order)  ;; microphone down (coarse)
  muc (multi f15 y   reverse-release-order)  ;; microphone up (coarse)
  mdf (multi S-f15 u reverse-release-order)  ;; microphone down (fine) --> NOT WORKING DUE TO KEYBOARD GHOSTING
  muf (multi S-f15 y reverse-release-order)  ;; microphone up (fine)
  mm  (multi f15 j   reverse-release-order)  ;; mute microphone

  sp  prev     ;; song previous
  sn  next     ;; song next
  pp  pp       ;; song play/pause

  ;; one-hand media ctl
  hpp (tap-hold-release $mt $mt pp lmet)    ;; hold for mod / song play/pause
  hsp (tap-hold-release $mt $mt prev lalt)  ;; hold for mod / song previous
  hsn (tap-hold-release $mt $mt next lsft)  ;; hold for mod / song next

  ;; set volume to specific values
  v00 (multi f15 esc  reverse-release-order)  ;; set volume to 0 %
  v25 (multi f15 spc  reverse-release-order)  ;; set volume to 25 %
  v50 (multi f15 tab  reverse-release-order)  ;; set volume to 50 %
  v75 (multi f15 ret  reverse-release-order)  ;; set volume to 75 %
  v99 (multi f15 bspc reverse-release-order)  ;; set volume to 100 %
)

luminosity

(deflayer luminosity
  XX   XX   XX   XX   XX        @loo @lsd @ugd @ugu @lsu      _  _  _
  @hm  @ha  @hbd @hbu @hra      @goo @gmd @bnd @bnu @gmu      _  _  _
  XX   XX   XX   @blt XX        @ooo @opd @bld @blu @opu      _  _  _
            @b00 @b25 @b50      _    @b75 @b99                _  _  _
                                                              _  _  _
)

alias

(defalias
  ;; brightness
  bnd brdn  ;; brightness down
  bnu brup  ;; brightness up

  ;; gamma
  gmd (multi f19 n reverse-release-order)  ;; gamma down
  gmu (multi f19 o reverse-release-order)  ;; gamma up
  goo (multi f19 m reverse-release-order)  ;; gamma on/off

  ;; underglow
  ugd XX  ;; underglow down
  ugu XX  ;; underglow up
  uoo XX  ;; underglow on/off

  ;; LED strip
  lsd XX  ;; LED strip down
  lsu XX  ;; LED strip up
  loo XX  ;; LED strip on/off

  ;; backlit
  blu (multi f19 . reverse-release-order)  ;; backlit up
  bld (multi f19 , reverse-release-order)  ;; backlit down
  blt (multi f19 d reverse-release-order)  ;; backlit toggle (on/off)

  ;; opacity
  opd (multi f19 h reverse-release-order)  ;; opacity down
  opu (multi f19 / reverse-release-order)  ;; opacity up
  ooo (multi f19 k reverse-release-order)  ;; opacity on/off

  ;; one-hand brightness ctl
  hbd (tap-hold-release $mt $mt brdn lctl)  ;; hold for mod / brightness down
  hbu (tap-hold-release $mt $mt brup lsft)  ;; hold for mod / brightness down

  ;; set brightness to specific values
  b00 (multi f19 esc  reverse-release-order)  ;; set brightness to 0 %
  b25 (multi f19 spc  reverse-release-order)  ;; set brightness to 25 %
  b50 (multi f19 tab  reverse-release-order)  ;; set brightness to 50 %
  b75 (multi f19 ret  reverse-release-order)  ;; set brightness to 75 %
  b99 (multi f19 bspc reverse-release-order)  ;; set brightness to 100 %
)

mouse

(deflayer mouse
  XX   XX   XX   XX   XX        XX   XX   @mbm XX   XX        _  _  _
  @ren XX   @trl @llm @hra      XX   @mcl @mcd @mcu @mcr      _  _  _
  XX   XX   XX   XX   XX        XX   @mwl @mwd @mwu @mwr      _  _  _
            _    _    XX        @mbl @mbl @mbr                _  _  _
                                                              _  _  _
)

alias

(defalias
  ;; mouse movement fine
  ;;   the position under "ctrl" was chosen to avoid key ghosting (common on
  ;;   laptops) that happens if "shift" is used instead.
  ;;mft (movemouse-speed 15)

  ren (tap-hold-release $mt $mt f2 lmet) ;; rename (F2) to meta_l

  ;; cursor navigation
  mcl (movemouse-accel-left  5 1000 1 15) ;; mouse cursor left
  mcd (movemouse-accel-down  5 1000 1 15) ;; mouse cursor down
  mcu (movemouse-accel-up    5 1000 1 15) ;; mouse cursor up
  mcr (movemouse-accel-right 5 1000 1 15) ;; mouse cursor right

  ;; mouse wheel
  mwu (mwheel-up    50 120)  ;; mouse wheel up    (button4)
  mwd (mwheel-down  50 120)  ;; mouse wheel down  (button5)
  mwr (mwheel-right 50 120)  ;; mouse wheel right (button6)
  mwl (mwheel-left  50 120)  ;; mouse wheel left  (button7)

  ;; mouse clicks
  ;; obs:
  ;;   the "mbl" is duplicated to avoid key ghosting when holding
  ;;   mlft and moving the cursor with movemouse-accel-* (neio keys).
  ;;     --> this is a chronicle problem with laptops.
  mbl mlft  ;; left button click   (button1)
  mbm mmid  ;; middle button click (button2)
  mbr mrgt  ;; right button click  (button3)

  ;; scratchpads
  llm (tap-hold-release $mt $mt M-A-t lsft)                  ;; large language model
  trl (tap-hold-release $mt $mt M-A-s (movemouse-speed 15))  ;; translator / slowdown mouse cursor
)

miscellaneous

(deflayer misc
  @sdm _    _    @cyp _         _    @me2 @me3 @cyy _         _  _  _
  @sla @cyr @mst @mnh @mca      _    @me1 @cye @mid @slo      _  _  _
  _    _    @mzc @mpn _         _    @mnm _    _    _         _  _  _
            _    _    _         _    _    _                   _  _  _
                                                              _  _  _
)

alias

(defalias
  ;; superscript letters
  sla RA-a  ;; ª
  slo RA-o  ;; º

  ;; currency
  cyp RA-p  ;; £/GBP sterling
  cye RA-e  ;; €/EUR euro
  cyr RA-r  ;; ₽/RUB ruble
  cyy RA-y  ;; ¥/JPY yen

  ;; macro
  mst RA-s  ;; street
  mnh RA-t  ;; neighborhood
  mca RA-g  ;; address complement
  mzc RA-c  ;; zip code
  mpn RA-d  ;; phone number
  ;;----------
  mnm RA-h  ;; name
  me1 RA-n  ;; email #1: personal
  me2 RA-l  ;; email #2: Unicamp/DAC
  me3 RA-u  ;; email #3: Unicamp/Recod
  mid RA-i  ;; ID number
  
  ;; symbol
  sdm RA-q  ;; diameter
)

youtube

(deflayer youtube-speed
  _    _    _    _    _         _    _    _    _    _         _  _  _
  _    _    _    _    _         _    _    _    _    _         _  _  _
  _    _    _    _    _         _    _    _    _    _         _  _  _
            -    u    \         _    h    a                   _  _  _
                                                              _  _  _
)

fn

fn1

(deflayer function-keys-1
  f11  f4   f5   f6   XX        XX   @tty XX   XX   XX        _  _  _
  f10  f1   f2   f3   XX        @hra @hs  @hc  @hsm @hm       _  _  _
  f12  f7   f8   f9   XX        XX   XX   XX   XX   XX        _  _  _
            _    _    _         _    _    _                   _  _  _
                                                              _  _  _
)

fn2

(deflayer function-keys-2
  XX   XX   XX   @tty XX        XX   f16  f17  f18  f23       _  _  _
  @hm  @ha  @hc  @hs  @hra      XX   f13  f14  f15  f22       _  _  _
  XX   XX   XX   XX   XX        XX   f19  f20  f21  f24       _  _  _
            _    _    _         _    _    _                   _  _  _
                                                              _  _  _
)

alias

(defalias
  tty (tap-hold-release $mt $mt XX (multi lctl lalt))  ;; hold ctrl_l-alt_l to switch tty
)