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

Inconsistent send on release behavior? #153

Open
AeliusSaionji opened this issue Jun 30, 2024 · 7 comments
Open

Inconsistent send on release behavior? #153

AeliusSaionji opened this issue Jun 30, 2024 · 7 comments

Comments

@AeliusSaionji
Copy link

In the following mapping pair, shift insert is sent after shift is released, but shift delete is sent after the timeout even while shift is held.

ShiftRight{Delete!250ms} >> ShiftRight{Insert}^
ShiftRight{Delete}  >> ShiftRight{Delete}^

Other quirky behavior occurs if you hold shift and start tapping delete. At that point, Shift Delete is sent on every quick tap, even though that's Shift Insert's rule.
Generally messing around with pressing Shift Delete also leads to other odd behavior I wouldn't have predicted based on the rules here.

Here's my full config

; Establish 0 delay on these keys
Shift    >> Shift
Control  >> Control
AltLeft  >> AltLeft
AltRight >> AltRight

ContextMenu{!250ms} >> Tab
ContextMenu >> ControlRight


ShiftRight{Delete!250ms} >> ShiftRight{Insert}^
ShiftRight{Delete}  >> ShiftRight{Delete}^
@ristomatti
Copy link
Contributor

I'm not on my computer to test this, but perhaps your intention was to have this instead?

ShiftRight{Delete{!250ms}} >> Insert ^
ShiftRight{Delete} >> Delete ^

I believe this should send ShiftRight{Insert} if Delete is tapped briefly while holding ShiftRight, and ShiftRight{Delete} if Delete remains down >250ms (while still holding down ShiftRight).

Having ShiftRight included also in the output part is redundant as long as the output does not begin with ^, !ShiftRight or !Any which would release the key before sending the rest of the output.

@AeliusSaionji
Copy link
Author

AeliusSaionji commented Jul 1, 2024

This unfortunately doesn't work.

Insert is sent alone, so it would seem shift is required to be part of the output. It is also still only sent after shift is released, so that part of the problem remains the same.

Also, the strange behavior remains (where Shift-Delete gets sent if you keep tapping Delete)

@houmain
Copy link
Owner

houmain commented Jul 1, 2024

Thanks for reporting. I could reproduce the strange behavior and will try to fix it.

@AeliusSaionji
Copy link
Author

I kept trying and found a definition that works. It seems to behave perfectly no matter how I try to abuse it, and ShiftInsert is sent immediately after pressing Delete without needing to release Shift first.

ShiftRight{Delete 250ms} >> ShiftRight{Delete}^
ShiftRight{Delete} >> ShiftRight{Insert}

The nonworking snippet copied from my first post:

ShiftRight{Delete!250ms} >> ShiftRight{Insert}
ShiftRight{Delete}  >> ShiftRight{Delete}^

The buggy behavior seems to be related to !250ms vs 250ms. These should be equivalent statements, but !250ms is behaving oddly.

@ristomatti
Copy link
Contributor

ristomatti commented Jul 1, 2024

This slight variation from my original suggestion seems to work consistently as well:

ShiftRight{Delete{250ms}} >> Delete ^
ShiftRight{Delete}        >> Insert

@AeliusSaionji
Copy link
Author

What does it mean to nest the 250ms like that? The behavior seems the same with or without it, but maybe I'm missing something.

@ristomatti
Copy link
Contributor

The key preceding it is held down 250ms.

houmain added a commit that referenced this issue Jul 4, 2024
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

3 participants