-
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
unilateral mod-tap shouldn't send KC_GUI to computer #48
unilateral mod-tap shouldn't send KC_GUI to computer #48
Conversation
fbaf635
to
4c296a8
Compare
This fixes a glitch in Miryoku's bilateral-combinations implementation where the GUI modifiers in a mod-tap key combination are always sent to the computer alongside the combination, interrupting the user's typing. For example, suppose you held LGUI_T(KC_A) and then pressed KC_R with the same hand (assuming your left hand on the standard QWERTY layout). Before this patch, the combination sends KC_LGUI to the computer when LGUI_T(KC_A) is held, followed by KC_A and KC_R when finally released. This inadvertently triggers whatever action is associated with KC_LGUI on the computer, such as opening the "Start Menu" in Microsoft Windows. With this patch applied, the combination doesn't send KC_LGUI to the computer when LGUI_T(KC_A) is held. Instead, it applies the KC_LGUI modifier *internally* for bilateral_combinations_hold() and therefore only sends out KC_A and KC_R to the computer as the user would expect. However, note that non-GUI modifiers such as Shift/Ctrl/Alt are still sent to the computer for unilateral mod-tap combinations to allow for modified mouse clicks such as Shift-click, Ctrl-click, Alt-click, etc.
4c296a8
to
a7d5e79
Compare
Thanks for this PR! I believe flashing of other mods can also be an issue, so perhaps this can be applied to all mods. For mouse use, register the mod after a timeout. That could be a new timer, or it could be integrated into this feature: Line 194 in b8f3651
|
Yes, I think Shift and Control are harmless and only Super and Alt are troublesome (e.g. Windows 10 use Alt to highlight keyboard shortcuts for ribbon/menu access). This could be solved by exposing a
Setting a timer would introduce additional delay on top of |
0f51eed
to
5fee83c
Compare
5fee83c
to
8f43b62
Compare
I've made the definition of what keys are considered "flashing mods" configurable to whatever the user wants, as follows. To suppress "flashing mods" such as the GUI keys (which pop up the "Start Menu" in Microsoft Windows) during bilateral combinations, add the following to your #define BILATERAL_COMBINATIONS_FLASHMODS MOD_MASK_GUI In addition, to also suppress the Alt keys (which pop up the "Ribbon Menu" in Microsoft Office) during bilateral combinations, specify a compound mask. For example: #define BILATERAL_COMBINATIONS_FLASHMODS (MOD_MASK_GUI|MOD_MASK_ALT) |
ecafb7a
to
8f43b62
Compare
Hey @manna-harbour, you were right: I'm having a much better typing experience after treating all modifiers as flashmods: #define BILATERAL_COMBINATIONS_FLASHMODS (~0) /* everything! */ The only problem remaining is the lack of mouse-click awareness for home row mods, which your timer suggestion would solve. For now, I'm working around the problem by pressing one of the Miryoku layer activation keys on the thumb cluster (i.e. normal home row mods plus Miryoku layer key) to get the home row mods to "register" to the computer when mod-clicking the mouse. |
Super+Period was triggering Start Menu afterwards, like a "flash mod".
Hey @manna-harbour, I have implemented your timeout suggestion now using QMK's deferred execution facility. This replaces the
Please try it out and let me know what you think. For me, it's working quite well so far, especially in combination with PR #54. Note: QMK's deferred execution feature was introduced 1 year later (on 16 November 2021 in commit 36d123e) after the latest in Miryoku's bilateral-combinations branch! So in order to try out my latest changes, you'll need to update this branch to a more recent version of mainline QMK. I've already done this (resolving merge conflicts) in a separate branch based on 0.18.6, so simply check out that branch and configure your |
17f266c
to
decb8b4
Compare
decb8b4
to
2e0e480
Compare
f0806e3
to
2e0e480
Compare
Sorry for the noise: I've been trying to modernize this branch by merging the latest QMK mainline so that we can use QMK's deferred execution feature cleanly. However, it ended up bloating this PR, so I moved it to a separate independent PR #55. |
For your testing convenience, I've created a modernized version of this PR that is updated to a recent QMK mainline (0.18.6). |
After poring over my current implementation at great depth and with relentless fervor, I have made substantial improvements in my
Here is a flowchart of the improved implementation, illustrating the complexity of this interconnected re-entrant monstrosity: Also, I found that QMK's deferred execution isn't preemptively scheduled, so I'm now setting my defermods timeout to 1ms: /* QMK */
#define TAPPING_TERM 200
#define IGNORE_MOD_TAP_INTERRUPT
/* Miryoku */
#define BILATERAL_COMBINATIONS
#define BILATERAL_COMBINATIONS_CROSSOVER 75
#define BILATERAL_COMBINATIONS_DEFERMODS 1 |
Superseded by PR #56. |
This fixes a glitch in Miryoku's bilateral-combinations implementation
where the GUI modifiers in a mod-tap key combination are always sent to
the computer alongside the combination, interrupting the user's typing.
For example, suppose you held
LGUI_T(KC_A)
and then pressedKC_R
withthe same hand (assuming your left hand on the standard QWERTY layout).
Before this patch, the combination sends
KC_LGUI
to the computer whenLGUI_T(KC_A)
is held, followed byKC_A
andKC_R
when finally released.This inadvertently triggers whatever action is associated with
KC_LGUI
on the computer, such as opening the "Start Menu" in Microsoft Windows.
With this patch applied, the combination doesn't send
KC_LGUI
to thecomputer when
LGUI_T(KC_A)
is held. Instead, it applies theKC_LGUI
modifier internally for
bilateral_combinations_hold()
and thereforeonly sends out
KC_A
andKC_R
to the computer as the user would expect.However, note that non-GUI modifiers such as Shift/Ctrl/Alt are still
sent to the computer for unilateral mod-tap combinations to allow for
modified mouse clicks such as Shift-click, Ctrl-click, Alt-click, etc.