-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Layer action triggers #1300
Comments
Maybe try switch and virtual key actions: simulator link (defsrc l)(deflayer base @l1)(deflayer layer1 _)
(defalias
l1 (multi (on-press press-vkey layer1)
(on-release release-vkey layer1))
)
(defvirtualkeys
enter-action1 w
release-action1 x
cond-release-action1 (switch
;; op
((key-history a 1)(key-history b 1)) y break
;; no-op
() z break
)
layer1 (multi
(layer-while-held layer1)
(on-press tap-vkey enter-action1)
(on-release tap-vkey cond-release-action1)
(on-release tap-vkey release-action1)
)
) |
the problem is that in this input order simulate cond-release-action1 is skipped completely (z expected), I have no idea other than brute force checking for key presses on every single key on the layer. |
You need to add extra ending time to the simulation:
|
I had the idea to scan for no-op with input-history, that simplyfies implemenation.
though i don't know why the magic number is |
Thanks, @jtroo ! It worked, although the structure is a bit complex for me. I also have a question: can the trigger in the |
I'm not certain what you mean by trigger but perhaps you're looking for the input items in switch? https://github.com/jtroo/kanata/blob/main/docs/config.adoc#input |
Similar to |
|
Yes, the magic number is 3, and I also do not know why that is. |
Is your feature request related to a problem? Please describe.
Yeah, I’d like to simulate a
tap-hold
action without a timeout. The reason is that the delay can be frustrating at times, as I want to wait until the timeout is up before activating the held layer.Describe the solution you'd like.
I’d like to suggest a new feature that would allow us to run specific actions when entering or leaving layers. The idea is to add a new configuration entry, such as
deflayeractions
to make this happen.Describe alternatives you've considered.
The
deflayeractions
entry should take at least two arguments:How It Could Look
Additional context
No response
The text was updated successfully, but these errors were encountered: