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

Rolling from ModTap key to Layer tap key (KC.LT) results in keypresses being emitted out of order #646

Open
DBendit opened this issue Nov 21, 2022 · 4 comments

Comments

@DBendit
Copy link
Contributor

DBendit commented Nov 21, 2022

Issue

When rolling from a ModTap key to a Layer tap key, the Layer tap key is emitted before the ModTap key.

Replication instructions

Using the following config: https://gist.github.com/DBendit/d094873364e37f36d80ccf9f71f2d8ac

Roll from 'l' to 'a'. 'l' is configured as a ModTap key (i.e. KC.MT), and 'a' is configured as a Layer tap key (i.e. KC.LT).

Expected results

The output should be 'la'.

Actual results

The output is instead 'al', with the following debug logs: https://gist.github.com/DBendit/f9906968246de3e8a1da4ec59f9d6e67

Misc

I originally ran into this without tap_interrupted=True, prefer_hold=False on the KC.LT keys, but adding those setting didn't help either. This is a frustrating experience trying to use home row mods where one of the home row keys on each hand is a layer shift.

I've been able to replicate this with keys on both sides of the split, as well as on the same side of the split (e.g. 's' and 'a').

Here's a debug log from 'ls', which works correctly. Notably, there's no ht_activate_on_interrupt event in this case. https://gist.github.com/DBendit/9c52e0290d2981822ea902bda25393d5

@DBendit
Copy link
Contributor Author

DBendit commented Nov 21, 2022

Workaround: Rather than using KC.LT, use KC.MT(KC.Key, KC.MO(<layer>)). This is effectively what the layer module does anyway, but it keeps all of the logic inside of the ModTap module.

@xs5871
Copy link
Collaborator

xs5871 commented Nov 21, 2022

tap_interrupted=True is almost definitely not what you want. Only pass prefer_hold=False to both KC.LT and KC.MT, that should do the trick.

@DBendit
Copy link
Contributor Author

DBendit commented Nov 21, 2022

@xs5871 You're right - getting rid of the tap_interrupted=True params from all of the mod/layer tap keys did get rid of the issue. It still doesn't explain why the behavior seen above happens differently for ModTap-only rolls vs ModTap-to-layer-tap rolls.

@xs5871
Copy link
Collaborator

xs5871 commented Nov 24, 2022

I don't have an immediate answer to that, and if you're issue is fixed, I'm not going to further investigate it for the time being.

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

No branches or pull requests

2 participants