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

feat: yet-another-chording feature: zippychord #1301

Merged
merged 55 commits into from
Nov 2, 2024
Merged

feat: yet-another-chording feature: zippychord #1301

merged 55 commits into from
Nov 2, 2024

Conversation

jtroo
Copy link
Owner

@jtroo jtroo commented Oct 20, 2024

Describe your changes. Use imperative present tense.

Output-character simplified chording, targeted at the "zipchord" use case. This is an implementation solely from looking at the docs and not the source of https://github.com/psoukie/zipchord, because I cannot be convinced to understand AHK code in-depth.

In the current state it is certainly not at feature parity and I'm sure there are incompatibilites/broken pieces, but it's probably ready for others to start playing around with.

Checklist

  • Add documentation to docs/config.adoc
    • Yes
  • Add example and basic docs to cfg_samples/kanata.kbd
    • Yes
  • Update error messages
    • Yes
  • Added tests, or did manual testing
    • Yes

@jtroo
Copy link
Owner Author

jtroo commented Oct 21, 2024

Some other TODOs:

  • space should be automatically parsed as the space character in the output. I don't see any good reason it shouldn't
  • need a separate dictionary to understand how to output a character
    • e.g. how to output %? IIRC typing symbols differs per locale. On Windows one can easily use unicode but unicode doesn't work as well in Linux. But should be able to tell the system how to do it, e.g. in US layout it is S-5.

@jtroo
Copy link
Owner Author

jtroo commented Oct 21, 2024

Bug:

  • activating the second of:
    .g	git
    .g f p	git␣fetch␣-p
    
    results in gitgit fetch -p (note the incorrect repeat git)

@nightscape
Copy link
Contributor

@jtroo amazing work!! 🎆 🎆 🎆

I'm just trying it out and it works very well so far.
Here a few comments:

  • chordsv2 automatically inserts a space after each chorded word. That gives a great boost in terms of typing speed, as a word is only one set of presses instead of two.
    That can be easily achieved in zippy by appending a space manually after each expansion in the zippy file (and not forgetting to turn off automatic removal of spaces at the line end in the editor 😉).
  • zippy currently expands too much/early. When I'm typing a word letter by letter it will trigger a chord in the middle of the word. In my chordsv2 config I had the following setting which worked quite well:
    (defchordsv2-experimental
      (include /Users/me/chords.tsv) () 50 first-release  ()
    )
    The 50ms were set as the pending_duration of the ChordV2. Is there a similar setting for zippy? I saw the zch_cfg_ticks_wait_enable field and set the value from 300 down to 50, but that doesn't seem to have the desired effect.
  • Being able to type composed chords out of multiple sets of keys, e.g. gt ing => getting or dy 1 => Monday is amazing!!!

@nightscape
Copy link
Contributor

One minor issue worth noting:
I switched back to chordsv2 for the time being (mostly because of the undesired chord expansions in zippy) and reverted the configuration so that there's no defzippy-experimental in my config anymore.
Despite (or because of) that, kanata crashes after a while with the following error:

thread '<unnamed>' panicked at src/kanata/output_logic/zippychord.rs:102:9:
attempt to add with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
09:36:17.6017 [ERROR] sending on a closed channel

@jtroo
Copy link
Owner Author

jtroo commented Oct 28, 2024

  • document smart spacing

@nightscape
Copy link
Contributor

nightscape commented Oct 30, 2024

It seems there's a small off-by-one bug in the smart-space implementation where it sometimes will delete all but the first typed character of the chord, leaving an output like ssound instead of sound.

@jtroo
Copy link
Owner Author

jtroo commented Oct 30, 2024

It seems there's a small off-by-one bug in the smart-space implementation where it sometimes will delete all but the first typed character of the chord, leaving an output like ssound instead of sound.

Thanks for testing and reporting!

@nightscape
Copy link
Contributor

I'd say this is ready for primetime!
One minor question: Would it make sense to make the punctuation keys in smart-space full mode configurable?
Personally, I'd like to add ? and ! to the list where an automatically added whitespace should get deleted.

@jtroo
Copy link
Owner Author

jtroo commented Nov 1, 2024

Smart space punctuation customizability added though not tested yet

  • add smart space punctuation tests

@jtroo jtroo merged commit 4ab74b8 into main Nov 2, 2024
4 checks passed
@jtroo jtroo deleted the zippy branch November 2, 2024 17:35
@ruhchjdbdbhccjjc
Copy link

Will this support chinese ?It appear do not support chinese .

@jtroo
Copy link
Owner Author

jtroo commented Nov 11, 2024

Will this support chinese ?It appear do not support chinese .

This doesn't support unicode output today; e.g. via clipboard manipulation or via OS unicode output mechanisms. Maybe one day it can be supported but for now no plans.

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.

3 participants