-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Key press / release is too fast for gnome-terminal #179
Comments
Just to have more contexts, are you using X11 (not Wayland)? |
I'm using wayland:
I'm running gnome-shell 42.5, fedora 36. I don't see any |
I've seen a similar behavior on Wayland and I feel it's relevant. Just to be sure about it, can you test the same thing on X11? Wayland has a lot of issues and I'm currently investigating how we could work around them. If this is one of such instances, I'd like to introduce the workaround after confirming that this is indeed the limitation of Wayland. |
Tested on x11, and it works fine there without the additional sleep. So yes it seems like a wayland thing. |
I had a very similar issue (Ubuntu 22.04 amd64, Gnome, Wayland), and @timbertson's patch worked for me too, thanks! FWIW, the issue was happening for me in Gnome terminal as well as Sublime Text. And thanks @k0kubun for this tool. I'm using it with my brother's https://github.com/berwynhoyt/wordstar-keys/tree/main/xremap to get the Wordstar diamond using CapsLock for the control key. It's great! |
Whatsapp Web has this problem even in X11! And, once again, this patch fixes it. To reproduce this, you need the following .yml file:
(This defines a key sequence that is supposed to delete the next word+space.) Now browse to web.whatsapp.com in google chrome and start typing a message to a friend. Now try the delete-next-word shortcut above. It often does only half the job. But this patch fixes it. |
I can reproduce the issue @timbertson has reported. On my laptop (Framework Laptop 12th gen), sleeping 3 seconds works, but sleeping 2 seconds doesn't. Not really sure this is depending on the hardware or not. I'm unsure that is coming from libinput, a Wayland compositor or something else. I can open a PR to "fix" the issue by introducing |
At this point, I'm okay with temporarily introducing the config, which I might remove once I find a way to fix the root cause. I'll accept a patch if any of you files that. |
Hmm, I accidentally put the delay right before |
Released the workaround as v0.7.6. |
Can you provide an example of where to put the - name: Tab shifting
remap:
LEFTCTRL-SHIFT-RIGHTBRACE: LEFTCTRL-PAGEDOWN
LEFTCTRL-SHIFT-LEFTBRACE: LEFTCTRL-PAGEUP
keypress_delay_ms: 20 Output: Error: Failed to load config 'config.yml': keymap[3]: unknown field `keypress_delay_ms`, expected one of `name`, `remap`, `application`, `mode` at line 45 column 5 - name: Tab shifting
remap:
LEFTCTRL-SHIFT-RIGHTBRACE: LEFTCTRL-PAGEDOWN
LEFTCTRL-SHIFT-LEFTBRACE: LEFTCTRL-PAGEUP
keypress_delay_ms: 20 Output: Error: Failed to load config 'config.yml': keymap[3].remap: unknown key 'keypress_delay_ms' at line 43 column 7 - name: Tab shifting
remap:
LEFTCTRL-SHIFT-RIGHTBRACE: LEFTCTRL-PAGEDOWN
LEFTCTRL-SHIFT-LEFTBRACE: LEFTCTRL-PAGEUP
keypress_delay_ms: 20 Output: Error: Failed to load config 'config.yml': keymap[3].remap: data did not match any variant of untagged enum Actions at line 43 column 7 |
I believe it's top-level, no indentation. |
Thanks! This worked. For reference: keypress_delay_ms: 20
modmap:
- name: Global
<....>
keymap:
- name: Global
<.....>
|
Some pplications have trouble understanding synthesized key events, especially on Wayland. keypress_delay_ms can be used to workaround the issue. see https://github.com/k0kubun/xremap?#keypress_delay_ms and xremap/xremap#179
I just started using xremap over xbindkeys and I love it, but I noticed one issue. I think the fault is in gnome-terminal, because other apps (chrome, firefox, nautilus) are fine. I have the following setup:
This gives me mac-style shortcuts for switching tabs.
Unfortunately it doesn't work in gnome-terminal or tilix (so it might be a bug in the underlying vte). They don't seem to register the combination, they just end up scrolling up/down or inserting some escape characters into the terminal.
I found that adding a tiny sleep here makes it work:
Obviously this a is dumb workaround and not xremap's fault, but would you be open to a PR which added some kind of
keypress_duration
config which controlled whether we do a short sleep between pressing and releasing the key?The text was updated successfully, but these errors were encountered: