-
-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
Implement lightweight trie-based Compose Key for QMK. #10063
Conversation
a0851a7
to
9cba98e
Compare
I'm not sure that this actually applies here, Also, this seems to be a similar implementation to leader keys. Also, nice on the additional tests |
Here's the relevant section of the Google guidelines: https://opensource.google/docs/patching/#license-headers-and-copyright-notices In particular, for the new files, "Googlers should add Google’s copyright notice (or a “The Project Authors” style copyright notice) to new files being added to the library if permitted by the project maintainers." The code is, of course, offered under the GPLv2 and may be used by the project as with any other contribution--it's just copyright of Google instead of me personally. And yeah, this is similar to leader key, but it's sequence-based rather than time-based and supports arbitrarily long command sequences at relatively low per-keypress byte cost. I haven't yet taken on the whole project, but I plan to migrate most of my existing Linux .XCompose (hundreds of sequences, some as long as five or six keypresses) to this framework and expect it to fit comfortably on my Gergo. |
https://opensource.google/docs/patching/#license-headers-and-copyright-notices
|
Seems you've force-pushed the previous |
Co-authored-by: Zach White <skullydazed@drpepper.org>
Ugh, sorry, looks like I made a mess of things while trying to catch up to |
Note that this is not currently working--it crashes my keyboard on boot when the compose sequence trie is large :( I'll update here when I get it figured out. |
OK, this now actually works on my Gergo, with a trie of ~100 compose sequences: https://github.com/agdphd/qmk_firmware/blob/argd/keyboards/gergo/keymaps/argd/compose.conf |
I imagine you have already seen it, but since #8359 hasn't been mentioned in this PR I thought it would be a good idea to link it, so people can compare the implementation (assuming they do the same thing). |
Thank you for your contribution! |
Thank you for your contribution! |
Description
Implement a knockoff of the Linux compose key which can emit a specified string (including Unicode if support is compiled in) when the user hits a new modifier
COMPOSE
followed by a configurable sequence of keys. Distinct from the Leader Key in two ways:Changes are mostly isolated to a new key processor which:
COMPOSE
is pressed, starts a state machine to search the trie with subsequent keypresses, whichCOMPOSE
againqmk
binary under the new commandqmk compose
, which generates a C file that statically initializes the user's compose sequence trie.I have added test coverage in /tests/basic and confirmed that
make test:basic
passes. (make test:all
seems to be broken atmaster
.) I have also tested this on my Gergo with the Linux Unicode string printer.New files list copyright of Google LLC instead of me per https://opensource.google/docs/patching/.
Types of Changes
Issues Fixed or Closed by This PR
Checklist