-
Notifications
You must be signed in to change notification settings - Fork 62
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
endgame: multi-mod crossover chords and typing streaks #56
base: bilateral-combinations
Are you sure you want to change the base?
endgame: multi-mod crossover chords and typing streaks #56
Conversation
c8d3914
to
407353e
Compare
67697f3
to
bd9b42f
Compare
I have fixed some corner cases, simplified the configuration, improved chording support, and upgraded to QMK 0.19.10. Eager mods are now enabled by default (so that mod-clicks Just Work out of the box) but you can delay them via
For example, here is a diff showing how my personal configuration settings have changed since I originally submitted this PR: -#define BILATERAL_COMBINATIONS_EAGERMODS 1
-#define BILATERAL_COMBINATIONS_EAGERMASK (~MOD_MASK_GUI)
-#define BILATERAL_COMBINATIONS_DEFERMODS 100
-#define BILATERAL_COMBINATIONS_CROSSOVER 75
-#define BILATERAL_COMBINATIONS_SAMESIDED 3000
-#define BILATERAL_COMBINATIONS_CHORDSIZE 4 // one side GUI, Alt, Shift, Control
+#define BILATERAL_COMBINATIONS_DELAY_MODS_THAT_MATCH MOD_MASK_GUI
+#define BILATERAL_COMBINATIONS_DELAY_MATCHED_MODS_BY 100
+#define BILATERAL_COMBINATIONS_ALLOW_CROSSOVER_AFTER 75
+#define BILATERAL_COMBINATIONS_ALLOW_SAMESIDED_AFTER 3000 I have also updated the original description of this PR (located at the top of this page) with this new information accordingly. |
Co-authored-by: jack <0x6a73@protonmail.com> Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: yiancar <yiancar@gmail.com>
Co-authored-by: Wolf Van Herreweghe <wolfvh@getupgamesofficial.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: jack <0x6a73@protonmail.com>
Thank you so much for sharing this! I've run into one minor annoyance that you might already be aware of. I'm using
Please let me know if you're not able to reproduce the issue, happy to share more info if needed! EDIT: Curiously, the same also applies to |
Interesting, I can't imagine why only a subset of shifted combinations would be affected. Try disabling the AutoShift feature? |
This was causing issues with nested taps for " and < manna-harbour#56 (comment)
Ah, that fixed it! 🙏🏻 |
There's one other minor annoyance I've come across that might be more directly related to the bilateral combinators. If I hold ⌘ and press tab a few times, then decide I want to also hold ⇧ in addition to (but without releasing) ⌘ while pressing tab to go backwards in the quick switcher, the ⇧ key is not registering at all. I wondered if it was because it was within the If I remove all of the If this never gets fixed I will just live with it, this typing experience is that good! 🤩 Thanks again for making it! |
I was able to reproduce your issue: since your configuration didn't define it, a default catch-all value was being supplied for |
Amazing! Thanks again! 🥰 |
Hi, i'm having the issue you've mentioned in #48 (comment) where holding a mod-tap button i still have to wait for the tapping term timeout before i can ctrl+click. Is that intended ? |
That's correct: modifiers are activated only after holding down for the initial TAPPING_TERM, and then the same-sided and crossover timeouts are stacked on top of TAPPING_TERM. Notably, the TAPPING_TERM still governs how long you need to hold a mod-tap key in order to make QMK trigger its hold behavior (as opposed to its tap behavior). Thereafter, my enhancement kicks in and performs further processing---so it's stacked on top of the already expended TAPPING_TERM. For example, imagine that TAPPING_TERM was 1 and SAMESIDED was 2 and CROSSOVER was 4. Then, to activate same-sided mods you would need to hold the mod-tap key for 1 + 2 = 3 milliseconds. Similarly, to activate crossover mods, you would need to hold the mod-tap key for 1 + 4 = 5 milliseconds. However, note that the mod is eagerly applied as soon as the mod-tap key is held for 1ms --- meaning that there's no extra waiting for mod activation. This allows for fast mod-click mouse usage, such as Shift-clicking multiple items in a file manager. |
Nice! Just started to use it, works well so far! but I think you should add |
Hello, Thank you for your work. Unfortunatelly, the merge fails on my fresh qmk clone...
Probably an upstream update that conflicts. Could you pull this change ? Thank you ! |
Based on the excellent work by Sunaku : manna-harbour/qmk_firmware#56
Hi, have you interest in try to upstream that to QMK? I think that would be appreciated by a lot of people. |
I very much support the notion of upstreaming this feature. Is there anything that would help you in this regard? |
Is there any way that I can restrict the bilinear combinations from some keys? For instance, I want to be able to press my tab key when holding down both of my alt keycodes, but right now I can only do it whilst holding down my right alt. |
Hey everyone, thanks for your interest in upstreaming this patch to QMK -- I'm short on free time (which is otherwise preoccupied with my ZMK port of this home row mods disambiguation logic, specifically for my new keyboard) so I hope to revisit this by the summer. Cheers. |
Yes, you should be able to edit the |
fyi the current merge conflict is trivial to resolve. Just need to delete the conflict markers to resolve. IGNORE_MOD_TAP_INTERRUPT no longer exists in upstream qmk. It is now default. My branch fixes it sunaku#1 |
People coming across this thread may also be interested in Achordion for a user-space library (patchless/standard QMK) with similar goals to this patch. |
I'm noticing, on Dvorak, that I can't use the left-side shift to type capital D, B, or F. However, using the right-side shift for those keys works. It's as if those keys are interpreted as being on the left side of the keyboard. I don't have this issue with I, X, or Y combined with right-side shift. |
any chance getting this more updated per @BlueDrink9 's comment? #56 (comment) |
it's easy as to do yourself fyi. Alternatively, I've found achordion a really good replacement |
manna-harbour/qmk_firmware#56 Added this patch after getting the latest qmk without userspace for miryoku as mentioned in manna-harbour/miryoku#287
This patch enhances home row mods & chords handling to avoid accidental misfires for a more natural typing experience. 😌🙌 Don't be dismayed by GitHub's display of "10K+ commits" and "5K+ files changed" in this PR: 💁 refer to the raw diff instead.
⭐Note: I've created a Vial version of this PR as well as a native QMK version of this PR to make it easy for users to try it out. 🎁
This PR supersedes #48 and #54 by implementing configurable multi-mod chord taps with uni/bilateral handling, delayed mods to solve #27, "eager mods" for mod-click mouse usage, and typing streaks for a natural typing rhythm. 🤩 See the Flowchart below for a visualization of this PR's logic (see my article for its motivation) and the Documentation below for each
#define
.Usage #
Here is the relevant portion of my
config.h
file which activates these features to provide the best typing experience I've felt since switching to Miryoku's home row mods 2+ years ago, as detailed in Taming home row mods with Bilateral Combinations:You also need to add the following line to your
rules.mk
file to enable QMK's deferred execution for delayed mod activation:DEFERRED_EXEC_ENABLE = yes
Tutorial #
Clone a fresh copy of QMK and merge this PR into it (or skip down to the
git remote
command if you already have a clone):$ git clone https://github.com/qmk/qmk_firmware --recurse-submodules --shallow-submodules $ cd qmk_firmware $ git remote add sunaku https://github.com/sunaku/qmk_firmware.git $ git fetch sunaku miryoku_bilateral $ git merge sunaku/miryoku_bilateral --no-edit
Now follow the instructions in the Usage section above:
config.h
file.rules.mk
file.Finally, build your keymap's specific firmware using
make
or QMK toolbox as usual.Flowchart #
Three main user actions drive the logic: tapping, holding, and releasing keys.
Everything happens depending on what keys they hold and how long they hold them.
#define
settings, documented individually below.Documentation #
To enable bilateral combinations:
config.h
file:rules.mk
file to enable QMK's deferred execution facility.DEFERRED_EXEC_ENABLE = yes
To enable same-sided combinations (which start on one side of the keyboard and end on the same side, such as
RSFT_T(KC_J)
andRCTL_T(KC_K)
in the abbreviation "jk" which stands for "just kidding"), add the following line to yourconfig.h
and define a value: hold times greater than that value will permit same-sided combinations. For example, if you typedRSFT_T(KC_J)
andRCTL_T(KC_K)
faster than the defined value, the keysKC_J
andKC_K
would be sent to the computer. In contrast, if you typed slower than the defined value, the keysRSFT(KC_K)
would be sent to the computer.To enable crossover bilateral combinations (which start on one side of the keyboard and cross over to the other side, such as
RSFT_T(KC_J)
andLGUI_T(KC_A)
in the word "jam"), add the following line to yourconfig.h
and define a value: hold times greater than that value will permit crossover bilateral combinations. For example, if you typedRSFT_T(KC_J)
andLGUI_T(KC_A)
faster than the defined value, the keysKC_J
andKC_A
would be sent to the computer. In contrast, if you typed slower than the defined value, the keysRSFT(KC_A)
would be sent to the computer.To delay the registration of certain modifiers (such as
KC_LGUI
andKC_RGUI
, which are considered to be "flashing mods" because they suddenly "flash" or pop up the "Start Menu" in Microsoft Windows) during bilateral combinations, you can define aBILATERAL_COMBINATIONS_DELAY_MODS_THAT_MATCH
setting specifying which modifiers should be delayed, and aBILATERAL_COMBINATIONS_DELAY_MATCHED_MODS_BY
setting specifying how long that delay (measured in milliseconds) should be.config.h
and define a bitwise mask that matches the modifiers you want to delay. For example, here we are defining the mask to only match the GUI and ALT modifiers.config.h
and define a timeout value (measured in milliseconds) that specifies how long modifiers matched byBILATERAL_COMBINATIONS_DELAY_MODS_THAT_MATCH
should be delayed. For example, here we are defining the timeout to be 100 milliseconds long.To suppress mod-tap holds within a typing streak, add the following line to your
config.h
and define a timeout value: a typing streak ends when this much time passes after the last key in the streak is tapped. Until such time has passed, mod-tap holds are converted into regular taps. The default value of this definition is0
, which disables this feature entirely. Overall, this feature is similar in spirit to ZMK's global-quick-tap feature.If you wish to target only certain modifiers (instead of all possible modifiers) for the typing streak timeout setting described above, add the following line to your
config.h
and define a bit mask: only those modifiers that match this mask will be governed by the typing streak timeout. For example, to exempt Shift modifiers from the typing streak timeout while still targeting all other modifiers, you can specify the following mask.To monitor activations in the background, enable debugging, enable the console, enable terminal bell, add
#define DEBUG_ACTION
toconfig.h
, and use something like the following shell command line:Commits #
Although this PR is polluted with irrelevant commit history (which was merged in from the newer QMK release 0.18.6+ that provides the deferred execution facility needed by this PR), you can filter out the noise by looking only at my own commits.