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

Input chords/combos with order #1004

Open
newsve opened this issue May 3, 2024 · 8 comments
Open

Input chords/combos with order #1004

newsve opened this issue May 3, 2024 · 8 comments
Labels
enhancement New feature or request gauging interest Looking for additional discussion and viewpoints

Comments

@newsve
Copy link

newsve commented May 3, 2024

Is your feature request related to a problem? Please describe.

Feel free to move this to discussions if it is out of scope (since you are working on chord v2, I thought I drop it here):

When using AHK, I wrote a behavior that interpreted the order of chords, first our starting point:

(defsrc 2 3)

(deflayer one vold volu)

When holding first 2, then pressing 3 and all in the very fluid roll-over motion, I would skip to the next song.

And when holding 3, then pressing 2, I went back to the previous song.

I did the same for navigation Chrome tabs (left and right and when used as a rolling motion go to tab 1 or to the last tab). I think not considering the order (as an option) might be a missed opportunity.

These combos are super satisfying, feel natural and work extremely well. Just try it yourself. They go fast into the muscle memory and you do them without thinking.

Describe the solution you'd like.

Syntax is up to you.

Describe alternatives you've considered.

You could create extra layers but this would get too cumbersome quickly and also stuff like consider idling make stuff even more complex.

Also fork and switch could be used, but it wouldn't be much better and again, idling wouldn't be considered.

Additional context

No response

@newsve newsve added the enhancement New feature or request label May 3, 2024
@newsve newsve changed the title Input chods/combbos with order Input chods/combos with order May 3, 2024
@newsve newsve changed the title Input chods/combos with order Input chords/combos with order May 3, 2024
@jtroo
Copy link
Owner

jtroo commented May 3, 2024

This feels like something that could be implemented by this: #128

@newsve
Copy link
Author

newsve commented May 3, 2024

Yeah probably, that issue and the thoughts behind, to give tap-hold even more granular control, are great and well invested time. They should make this use case even more feasible.

However, you'd still need a dedicated layer, or two for our example, so the config might get a bit bloated with empty layers and just one or two actions.

Then, I find that input chords, if only two keys are used, are very similar to a tap-hold config with a layer but terser in syntax, but again less flexible in usage (I think they do not work on layers or do they?). Moreover, I assume they do not share the same behavior when looking at idling and the different tap-hold-behaviors.

But once we talk about +3-key-combos we are in a different territory, so it's not trivial to find a good design which is easy to implement, to understand and to combine with other constructs at the same time.

@jtroo
Copy link
Owner

jtroo commented May 3, 2024

A custom tap-hold behaviour could add arbitrary logic, it could accommodate 3 presses and more.

But perhaps another way that exists today is sequences: simulator.

@jtroo
Copy link
Owner

jtroo commented May 3, 2024

Though perhaps this variant might be better so that key repeat is not lost.. at least I think. I haven't tested it for real 😅

@jtroo jtroo added the gauging interest Looking for additional discussion and viewpoints label May 4, 2024
@GrewHair
Copy link

GrewHair commented Jun 1, 2024

I'd very much second this, because then it becomes like typing jk in vim to exit the insert mode - but system-wide! All just by adding/changing a single line and without losing key repeat.

One particularly enticing use case for me personally would be this: let's say I want to invert the number row to be able to type symbols like $, *, etc, more easily; and I'm (usually) ok with having to reach for the numpad to type numbers; but I don't want to lose the immediacy of hitting e.g. 21j in vim to quickly jump 21 lines down. "Ordered chords" would make that a breathe. With how things are now tho, (2 1 j) and (1 2 j) can't be distinguished.

With that said, chords v2 rock anyway 🙃.

@gerhard-h
Copy link
Contributor

Does switch and key-history work in theory inside a chord activation to figure out the order?

@jtroo
Copy link
Owner

jtroo commented Jun 1, 2024

Does switch and key-history work in theory inside a chord activation to figure out the order?

It should work in theory, that's a good thought.

@GrewHair
Copy link

GrewHair commented Jun 1, 2024

Does switch and key-history work in theory inside a chord activation to figure out the order?

As a matter of fact, input-history does it (man, you've got to admire how neatly abusable Kanata's feature set is becoming). @gerhard-h, thanks for a great idea!

@newsve, give this a shot:

(defchordsv2-experimental
  (2 3) (switch ((input-history real 3 1)) next break () prev break) 200 all-released ()
)

It gets a bit hairy with chords of 3 already tho, as you have to process 3! = 6 cases. But at least you can pull those autohotkey 2 & 3::, 3 & 2:: tricks without much fuss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gauging interest Looking for additional discussion and viewpoints
Projects
None yet
Development

No branches or pull requests

4 participants