Skip to content
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

Preserve layers on release if there is a pending action #737

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lobre
Copy link

@lobre lobre commented May 3, 2024

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, the control should stay activated if another action is set as pending before the release of the modifier.

capslock = overload(control, esc)

This helps if I combine this with a key that is behind a timeout.

c = timeout(c, 1000, M-c)

That way, if I want to do control-c (by doing capslock combined with c), it will send control-c even if the modifier capslock is released before the release of c.

As explained in the issue, I don’t see a reason why somebody would not apply the control version of c when c is pressed while control is held. The fact that control might get released before the release of c 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.

@lobre lobre force-pushed the pending-preserve-layers branch from bd73664 to d962575 Compare May 3, 2024 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant