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

With Caps remapped, after emulating escape two times, it stops working #8

Closed
dmedvinsky opened this issue Oct 19, 2012 · 5 comments
Closed
Assignees

Comments

@dmedvinsky
Copy link

Hello. I'm having some weird issue with xcape and Caps mapped to Control. The thing is, it works only for the first two presses, and then stops. It still works with normal Control key, but not with Caps, until restarted.

Here's how I map Caps to Control:

dmedvinsky at zeus in ~
><((°> cat /etc/X11/xorg.conf.d/20-keyboard.conf 
Section "InputClass"
    Identifier "keyboard defaults"
    MatchIsKeyboard "on"
    Option "XkbLayout" "us,ru,"
    Option "XkbOptions" "grp:alt_space_toggle,compose:menu,ctrl:nocaps"
EndSection

Here's the output of xcape --debug:

dmedvinsky at zeus in ~
><((°> pgrep xcape

dmedvinsky at zeus in ~
[1] ><((ˣ> xcape --debug
sig_handler running...
Intercepted key event 3, key code 36
Intercepted key event 2, key code 66
Control pressed!
Intercepted key event 3, key code 66
Control released!
Generating ESC!
Intercepted key event 2, key code 9
Intercepted key event 3, key code 9
^[Intercepted key event 2, key code 66
Control pressed!
Intercepted key event 3, key code 66
Control released!
Generating ESC!
Intercepted key event 2, key code 9
Intercepted key event 3, key code 9
^[Intercepted key event 2, key code 66
Intercepted key event 3, key code 66

That is me running it and pressing Caps key three times in a row with a couple of seconds in between key presses and no other keys pressed.

@dmedvinsky
Copy link
Author

Oh, I'm running latest master.

@ghost ghost assigned alols Oct 21, 2012
@benarmston
Copy link

As you are probably aware, the option ctrl:nocaps results in two Control_L keys. It is this duplicated key which seem to be the problem. As proof of that the following xmodmap commands also produce this problem:

remove Lock = Caps_Lock keysym Caps_Lock = Control_L

I have been able to work around this issue by using a different XkbOption, namely, caps:ctrl_modifier. This results in the caps key using the Caps_Lock keysym, but being treated as a control key. xcape can then be run with ``xcape -e 'Caps_Lock=Escape' to get the desired behaviour.

Unfortunately, it is not possible to then map the escape key to become a caps lock. As doing so results in two keys using the Caps_Lock keysym, and the crashing occurs once again.

Is support for multiple keys using the same keysym something that could be added to xcape? If so, I may take a look at doing so when time permits.

@alols
Copy link
Owner

alols commented Nov 6, 2012

I have been remapping Caps Lock to Control using the GUI in GNOME and that always worked. I'm not sure how to reproduce the problem on my machine running Linux Mint.

@dmedvinsky
Copy link
Author

@benarmston Thanks for the info, I'm using caps:ctrl_modifier now in my X config, as I don't really care about remapping Esc to Caps. This way it seems to work fine.

@alols I believe you can do setxkbmap -option 'ctrl:nocaps' to try to reproduce. Although, after updating to latest master I can't reproduce it by myself anymore.

@alols
Copy link
Owner

alols commented Nov 6, 2012

@dmedvinsky I assume this means I can close the issue now.

@alols alols closed this as completed Nov 6, 2012
allgreed added a commit to allgreed/dotfiles that referenced this issue Feb 7, 2020
When the computer first booted I had to press ctrl, otherwise xcape
would not process single CapsLock press correctly.

This was due to the confusion of having two keys produce the same
keysym. The workaround is to assign the CapsLock to CapsLock, but remove
the Lock modifier and add Ctrl modifier instead, then reconfigure xcape
accordingly.

Relevant tracker info: alols/xcape#62
Solution from: alols/xcape#8 (comment)
allgreed added a commit to allgreed/dotfiles that referenced this issue Feb 7, 2020
When the computer first booted I had to press ctrl, otherwise xcape
would not process single CapsLock press correctly.

This was due to the confusion of having two keys produce the same
keysym. The workaround is to assign the CapsLock to CapsLock, but remove
the Lock modifier and add Ctrl modifier instead, then reconfigure xcape
accordingly.

Relevant tracker info: alols/xcape#62
Solution from: alols/xcape#8 (comment)
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

3 participants