Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there any way to let the Shift, Ctrl and Alt keys behave as toggles under X? I know how one could do it under CLI (for example, by doing this) but found no reference for doing so under X.

Please note that this is not a question on sticky keys, which can be enabled by an accessibility option.

share|improve this question
Depends on what you are toggling for that would make a difference of the process. –  Casey Keller Oct 13 '10 at 4:11
@Casey Couldn't it be like caps lock (whose ON/OFF states are irrespective of incoming keys or mouse actions)? –  Gödel Oct 13 '10 at 6:22

2 Answers 2

This is implemented on the DE level AFAIK. KDE has the option to Lock Sticky Keys:

With Lock Sticky Keys enabled:

If you press the Shift key twice then press the F key, the computer interprets this as Shift+F. Now if you type a P, the computer interprets this as the letter P (Shift+P). To de-select the Shift key, press it again.


share|improve this answer
That's a good answer for KDE users, though it isn't for GNOME users like myself. –  Gödel Oct 18 '10 at 21:04

Keys in X11 are remapped with xmodmap, but there is no Control_Lock in /usr/include/X11/keysymdef.h

If you have a few keys you could map Control to something like ISO_Next_Group_Lock and define your keys in this group with Control + Key.

I found some info here: https://bbs.archlinux.org/viewtopic.php?id=75771

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.