Preserve layers on release if there is a pending action #737
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
This is an attempt to find a solution for #722.
I suggest reading the issue to understand the problem as I tried to explain it as precisely as I could.
I am creating this PR mainly as a draft for now, as I am not sure exactly about the right way to tackle the problem.
Here, I just tried to take care of
overload
, but the behaviour is the same for other layer activation mechanisms. The idea is that for an overload like below, thecontrol
should stay activated if another action is set aspending
before the release of the modifier.This helps if I combine this with a key that is behind a timeout.
That way, if I want to do
control-c
(by doingcapslock
combined withc
), it will sendcontrol-c
even if the modifiercapslock
is released before the release ofc
.As explained in the issue, I don’t see a reason why somebody would not apply the
control
version ofc
whenc
is pressed whilecontrol
is held. The fact thatcontrol
might get released before the release ofc
is a misbehaviour, and so the proposition is to avoid this situation by enforcing the initial intent of the user.For sure this small implementation is wrong. I already noticed a bug that I cannot exactly reproduce, where the modifier gets stuck.
So this PR is mainly a starting point to discuss the problem and receive guidance on a proper solution.
I have been using keyd for months, trying a lot of different workflows and I am generally really satisfied with the ergonomics, apart from this bug that makes me miss a lot of modifiers each day...
Thanks in advance for your help and bear with me, I just spent a few hours trying to understand the codebase, so there are probably things I missed.