-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Modifiers in modifier functions get dropped in certain programs/desktop environments #759
Comments
Could you show the timings when you press a keycode like that in QMK? The solution for #756 does not apply here, as that is for hold-taps and does not apply to shifted keycodes. |
Are you using ZMK while connected through bluetooth or usb? Could you verify the issue is the same using both connection methods? It seems QMK is not processing the shift and '-' keyup events quickly, but adding some 16ms delays in between. To emulate this we may have to somehow queue keypresses instead of processing them as fast as possible. I've never had issues with 'deliberate pressing shift' or not, so can't really say anything about that. |
I'm seeing this behaviour too, LC() isn't working for me in RDP |
Potentially related: qmk/qmk_firmware#13708 |
A workaround that mostly seems to work for individual I set Unfortunately the issue also applies to |
I have a similar timing issue on gnome (wayland + fedora) But even stranger, in sway (a wayland tiling window manager) I never get tbat error. I get it with bluetooth and usb. Are there values I can tweak in the config for timing ? |
@rambip I have a similar problem with sticky keys; in Sway they are reliable, but in GNOME they are hit or miss. |
Sorry for the shitty video, but here's a demo: muestra2.webm |
Even in GNOME, it doesn't happen under Qt apps. This also affects things like |
Because I'm having the same problem in Gnome & Wayland I used @abstracterror's helpful macro workaround. I agree it makes modified key presses work much more consistently, but it is still not perfect. I didn't want to write a macro for every shifted key I use, so I wrote this C preprocessor macro that generates ZMK macros: #define SHIFTED(sym, macro_label) s_##sym: s_##sym {\
label = macro_label;\
compatible = "zmk,behavior-macro";\
wait-ms = <50>;\
#binding-cells = <0>;\
bindings\
= <¯o_press &kp LSHFT>\
, <¯o_press &kp sym>\
, <¯o_release &kp LSHFT>\
, <¯o_pause_for_release>\
, <¯o_release &kp sym>\
;\
} My macros section looks like this: macros {
SHIFTED(EXCL, "shifted_excl");
SHIFTED(AT, "shifted_at");
SHIFTED(HASH, "shifted_hash");
/* etc. */
}; That lets me use bindings of the form I'm passing in the shifted codes (like I tried to derive the label from the first macro argument, but I couldn't figure out how to get macro-level string interpolation or concatenation to work. So I gave up, and used a second argument for the label. I hope this is helpful for someone in a similar situation. Edit 2022-12-15: I edited the preprocessor macro above to release |
As far as I can tell, this is an upstream issue: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5890 |
Until this is fixed in Gnome is there a way to adjust the internal timing globally so we don't need to write a macro for every shifted key? |
Annoyingly, it doesn't seem to affect QMK :( |
I've just noticed a comment in that issue that suggests running It looks like ibus provides features like input methods for alphabets other than the Latin one, and for emoji. I'm not sure, but it might also be required for switching input methods. I don't know much about the consequences of disabling it. I also don't see any built-in option to disable it permanently. Comments I'm seeing in searches say that "Gnome requires ibus". |
@hallettj Sadly this didn't work for me. Maybe because I'm using Killing iBus also killed the keyboard input so I had to reboot. |
@pergamomo I'm the original poster of that workaround, and I'm using the same layout. Not sure what ibus really does, but I read something about input methods and thought that this could be the problem. |
Not sure if this helps anyone, but using Remote Desktop on Windows (in windowed mode) solved this issue for me connecting to both other Windows machines as well as Ubuntu machines. Full screen: issues with hold-tap and layers. (even when stretching the window across my entire screen) |
Also relevant: qmk/qmk_firmware#19449 From the PR description it sounds like sending modifier events separate from other key events helps with both RDP and Gnome scenarios. |
@JMHAVANCE I have a theory about why it works for you in windowed mode but not fullscreen: There's an option in the windows RDP settings called something like "Apply windows hotkeys locally (e.g. alt-tab)". (In the config file, I think this is "keyboardhook"). It has three values: "always" (1), "never" (0), and "only when full-screen" (??). Maybe you have "only when full-screen" selected and thus windowed/fullscreen makes the difference for you? For me, I found that setting this value to "never" fixes the problem even when I am fullscreen (which I basically have to be, because the weird layout of my monitors makes it impossible for a window to cover all/only my active pixels.) |
|
@manna-harbour, I've looked what Any information would greatly help. Thanks in advance! |
I'm sorry, I didn't realize that the link I sent was about Mod-Tap specifically. Would there be something similar for modifier functions? |
I've tried a lot of things and finally realized that the workaround of a macro slowing things down did work over USB but not Bluetooth. I am now wondering if one of the system configuration for Bluetooth could help here. I've tried to understand what For anyone wondering what my macro looks like, here's the snippet I use which makes use of zmk-nodefree-config helpers:
|
Note that |
Would setting |
I don't think it would since they are control bindings, not actual behaviors. |
I found success with the following from
I observed symbols getting converted to the un-shifted state in Alacritty,
Although if I press the layer-tap, wait a little, then press the I'm using bluetooth, X11, gnome 42, and not using remote desktop. |
- mitigate issue where <->&kp <symbol> outputs the unshifted code, if typed quickly, if using Alacritty - add behavior that hits shift ->key w/ a small delay - see zmkfirmware/zmk#759
Thanks, that also works for me with gnome 44 and wayland. |
I just retried the vanilla setup with The usage of the macro does not allow me to use mod-morph when the modifier key uses that macro. For example, I want a key where |
We are veering off topic here, but you don't need the macro for the second mod morph? You are already holding down shift, so define |
For windows remote desktop set:
It works fine on my setup |
This issue also happened while using Parsec immersive mode (like the fullscreen of rdp). |
in my case it works when picking "On this computer", not the remote one |
In my case of Windows RDP, set to "On the remote computer" or "Only when using the fullscreen" not work, set to "On this computer" just make the |
Sorry, thought it was about shifted characters like ':' or '{'. |
Just tested on my side with RDP via Bluetooth and the |
Can you check whether it's actually sending separate reports? Also, could you elaborate on how you got those results? Maybe a similar solution to #2334 in the keypress function could further improve the situation, but I can only test that if I can reproduce this. (For me the keys register correctly in all programs I've tried since #2334) |
I'm on Windows on the remote and the host, so the only software I know of for timing is the QMK Configurator test page. This is what I get most of the time on Bluetooth and sometimes wired for
This is what I get otherwise:
For something like the right ALT modifier, it gets worst:
I have no idea how can these events be so much out of order. As I said in this thread, I have a macro setup to lengthen the timing of everything, but even with that I still get the issue here and there. |
Weird ... tbh I don't really have an immediate idea as to how this could occur. I mean in the third example you aren't even pressing control right? |
About the third example, I think it might be related to the fact that Alt Gr (right Alt) is sometimes interpreted as left Ctrl + left Alt. I'm unsure if this changes something, but my Windows keyboard layout is set to Canadian French. There is a lot on my config, but the examples above have been generated with the keys on the left home keys: https://github.com/kevinpastor/zmk-config/blob/5d2609eb8db9e842378362d9a538656c7f6ca355/config/corne.keymap#L139 |
So it seems as if the mod releases (the ones after the actual keypress -> #2334) are done correctly. |
Let me know if there's anything I can do to help or test. |
I just realized that caps word is also affected by this making it unusable on RDP 😕 |
Edited to make it more generic: This issue is concerning the timing of keys sent by ZMK when modifier functions are involved, such as
&kp LA(TAB)
,&kp HASH
(equal to&kp LS(N3)
) etc. Some applications/desktop environments don't seem to like how ZMK sends these keys and sometimes ignores the modifier parts of these keycodes, leading to unexpected behavior. So far issues have been observed in:Original post
There are issues using sending key presses with modifier functions and overall issues with held modifiers when using the RDP app ("Remote Desktop Connection") on Windows 10. I use it for connecting to a local VM with Hyper-V using
vmconnect.exe
, so there is no network latency. For instance when sending a key press likeLALT(TAB)
the modifier is almost always ignored. When using regular modifiers like Shift, they are also not detected some of the time.Note that there is also a different RDP app ("Remote Desktop Classic" on MS Store) that doesn't seem to have the issue, so it is likely related to the peculiar handling of keyboard inputs of the former app. However this app doesn't allow connections to Hyper-V VMs.
Here is me sending
&kp UNDER
in the host (not using RDP) on https://config.qmk.fm/#/test:Here it is on the remote VM through the classic RDP app:
Worth noting that the
minus
keycode is also reported differently, but I don't know if that has any relevance.Could it potentially be helped by a parameter like
tap-duration-ms
as proposed in #756? Or maybe the RDP app expects keycodes to be spaced apart in time?The text was updated successfully, but these errors were encountered: