kanata
kanata copied to clipboard
Fake key does not triggered inside nested `multi`
Not all fake key release actions are registered if they were put in nested multi blocks.
Here is sample config. Hold the caps and tap the 1 to stuck in the lol layer. Comment out the release_mods and all will work fine.
(defcfg
linux-dev /dev/input/by-id/usb-MyFourButtonKeypoard-event-kbd
)
(defsrc
caps 1 2 3
)
(deflayer base
@fn 1 2 3
)
(deflayer fn
XX @tolol _ _
)
(deflayer lol
XX @lol @lol @lol
)
(defalias
release_mods (multi
(on-release-fakekey lsftfk release)
;; More mod keys here.
)
release_layers (multi
(on-release-fakekey tololfk release) ;; <- this key never gona be released
;; More layers here.
)
fn (multi
(layer-while-held fn)
@release_mods ;; <- comment this to be able to release fake key below
@release_layers
)
tolol (on-press-fakekey tololfk press)
lol (macro l o l)
)
(deffakekeys
tololfk (layer-while-held lol)
lsftfk lsft
)
Likely issue can be fixed by recursing into multi here: https://github.com/jtroo/kanata/blob/f40f4e4711915c6a058d91cbaf088c544f262a32/src/cfg/mod.rs#L788
Edit: rather than recursing (which the code already does), the solution is to flatten multi.