-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat(behaviors): add non-overlap behavior #2391
base: main
Are you sure you want to change the base?
Conversation
aa6ceb2
to
d4e656b
Compare
A couple of general thoughts moreso on the concept, rather than on the implementation:
|
It's always been a non-overlap behavior. The default instance is Any other bindings can be used as well.
I'm already working on it.
This is documented in "Multiple instances."
I'm open to discussion. The only terms I have in mind are 'zero overlapping', 'non-overlapping'. I drop the 'ing' because it feels clunky. 'No overlap' is also great. |
Excellent. This should probably be documented better, then. Apparently I was a bit blind w.r.t. multiple instances.
SOCD, mutually exclusive, interrupt, XOR are all terms that come to mind which could inspire a name. I think my personal preference would be to call it the "Mutual Interrupt Behaviour", and rename/redefine |
Peanut gallery: +1 to "interrupt" and "resume" as keywords, as they are plain English words whose meaning fits the behavior well. Before today, I had no idea that SOCD meant simultaneous opposing cardinal directions, and likewise those not steeped in programming or maths might not immediately read XOR as exclusive-or. |
I considered using 'multiple groups,' but the term 'group' is reserved for a future feature that groups multiple instances with different bindings. To prevent key presses and mouse keys from overlapping each other for example.
"Only one key to be pressed" does not mean "only the most recent key to be pressed". It could also mean that the first key remains pressed when the second key is pressed, and the second key resumes only after the first key is released. I call this This is also reserved because I haven't figured out how to implement it yet, but the idea is there.
Fantastic. |
My suggestion here would be to use "interrupt" in the name of the behaviour, and call this property
|
The name of the behavior is 'interrupt'. And the 'invert' of 'interrupt' is resuming the pressed keys in reverse order or having 'no interrupt' at all? How can 'no interrupt' be a feature of 'interrupt'? Wouldn't that just make it a regular key press? I looked up dictionaries, asked a couple of LLMs and found these synonyms:
I also came across the internet and read about this topic. They either use the phrase 'no overlap' or 'no two simultaneous' to describe the key function. Take a look at this post. With all the obscure names like Snap Tap, SOCD, and Null Bind, they still have to explain how it works. Using the two phrases 'no overlap' or 'no two simultaneous,' of course.
I'm thinking of |
I was thinking of inverting the way in which they interact, but I see how that can be confusing. I think "no overlap" and "no two simultaneous" are good keywords to describe the result, but not as good keywords to describe what is happening to cause that result. Here's my new suggestion: Call it the
Is this as an alternative to |
We named a behavior 'key press' and not 'keycode send' for a reason. I would definitely use a descriptive name when it comes to the technical side. But keep in mind that we are naming the behavior for a broad audience.
Yes. I was referring to the same thing. As I was typing the previous text, I realized that
|
That's a good point. The other point that I want to raise against non-overlap/no-resume is that it's generally not the best idea to begin names with a negation, for various reasons. EDIT: I think we could note it as the "mutex" behaviour in the sidebar and call it the "Mutual Exclusion Behaviour" as a longer form term |
Every existing non-overlap implementation has 'resume' enabled by default. Assuming we name this property
If users want 'no resume', they either have to create a new instance or use
Compare to
We have a clear option to make it simple and easy to use, we should go for it. And it's a common practice to use
There's nothing wrong with negative prefixes. Non-profit organizations, non-smoker, non-fiction, etc.
No one is familiar with the term 'mutual exclusion'. I wouldn't teach the entire multithreading course or statistics in the documentation just to explain how 'mutex' works. |
You have a point about |
Just had a thought that perhaps it would make sense to take inspiration from |
Pre-commit failed because of clang-format. I'm currently using v18. #2315
Usage: The default instance
&nkp
uses&kp
binding. Any keycode should work.Example:
&nkp A &kp S &nkp D
. This makes A and D do not overlap each other. More in docs.https://deploy-preview-2391--zmk.netlify.app/docs/behaviors/non-overlap
Closes #2385