Skip to content
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

c-h and xcape control as esc conflict #157

Open
popeliao opened this issue Mar 27, 2022 · 3 comments
Open

c-h and xcape control as esc conflict #157

popeliao opened this issue Mar 27, 2022 · 3 comments

Comments

@popeliao
Copy link

My setup:
1 use xkeysnail to swap capslock and left contrl
define_modmap({
Key.CAPSLOCK: Key.LEFT_CTRL
})
2 use xcape to make a single press on capslock become esc
xcape -e 'Control_L=Escape'
3 use xkeysnail to map "c-h" as "BACKSPACE"
K("C-h"): K("BACKSPACE"),

Issue:
even "c-h" is mapped as "BACKSPACE", it also triggers a "esc" as "control" is also somehow sent by xkeysnail.

Workaround:
I use left shift as esc at the moment:
xcape -e 'Shift_L=Escape'

Question:
why is xkeysnail still sends another single "control" when "c-h" is already mapped to "backspace"? I think this is a bug.
Anyway, really thanks for this project, xkeysnail really helps me for my transition to linux from macOS

@joshgoebel
Copy link

joshgoebel commented May 28, 2022

It's not a bug, it's intentional. We deliver keystrokes the moment they are pressed because you never know WHAT might be listening to them (or what will follow)... we don't know when you hit Ctrl that it's part of a Ctrl-h sequence... it might even do something on it's own.

So we press it immediately, then when we see the H we realize it's part of a remapping (that doesn't include it) we release it and then after we type "backspace" (with no modifiers) we immediately press it again... because you might be typing a sequence.

  • Ctrl - H
  • Ctrl - X

This is common in many apps and can be done without lifting your finger off of control. So that is why holding control really means holding control - before we see any modifiers come across the wire.

@joshgoebel
Copy link

FYI: This is already fixed in my fork... I've added the concept of "suspended" keys... keys that you've pressed but (for a period of time) we aren't sure what to do with - because we don't know if you mean the literal key or if you're using them in an entirely different context. If you are comfortable running xkeysnail from source let me know, I could use beta/alpha testers.

@joshgoebel
Copy link

@popeliao If you'd want to join the new discussion on this issue at my fork (where I've been trying to fix this):

joshgoebel/keyszer#9

I'd truly like to fix this, but turns out it's a hard problem. Your feedback might be helpful. Please see issue #9 and at least read the recent update, which is a summary. Then if you have any thoughts please share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants