You are not logged in.
I have a single dead key on my Lenovo T550 - the left shift key.
I would like to make the left ctrl key act as a shift key.
After many failed attempts I found that
$ setkbmap -option "ctrl:swapcaps"will make the ctrl key act as a caps lock key, but haven't had any luck getting it to behave as a shift key.
Can anyone help?
DE xfce4
Last edited by redart (2026-04-30 23:27:07)
Offline
grep ctrl /usr/share/X11/xkb/rules/base.lstYou'd need to write a custom layout.
setkbmap -option "caps:shift"would turn caps lock into a normal shift
Alternatively you can use sth. like keyd to provide this on a lower level (and the console and wayland)
Offline
Thank you seth, that would be a better option (turning the caps lock key into shift), but
setxkbmap -option "caps:shift"doesn't work on my keyboard (Generic 105-key PC). CapsLock still acts like capslock.
setxkbmap -option "ctrl:nocaps"successfully turns the CapsLock key into a Ctrl key, but
setxkbmap -option "shift:nocaps"doesn't turn it into a Shift key.
Offline
OK....think I finally figured it out after some more googling. Found the keycode for CapsLock (66) using
xmodmap -pke | grep CapsThen created a .Xmodmap file in my home directory and added
keycode 66 = Shift_LCapsLock now behaves like a Shift key ![]()
Offline
Using xmodmap isn't necessarily preferable…
What does
setxkbmap -print -query look like?
nb. that -option is additive until you clear the options w/
setxkbmap -option ""Offline
Think I just found out why it might not be preferable ![]()
When I first ran "setxkbmap -print -query" I got
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+gb+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
};
rules: evdev
model: pc105
layout: gb
options: Shift_L:swapcaps,lshift:swapcaps,shift:swapcapsThat last line kinda surprised me as I'd been using the <-option ""> after figuring out the need to clear previous attempts. So I ran
<setxkbmap -option ""> and then "setxkbmap -print -query" gave
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+gb+inet(evdev)" };
xkb_geometry { include "pc(pc105)" };
};
rules: evdev
model: pc105
layout: gbOnly after this my "fix" no longer worked and CapsLock was back to being CapsLock.
Had to run
xmodmap .Xmodmap to get it to work again. I'm guessing a logout or restart will undo my temporary fix.........nope, still working after both.
Curious to know of any better way, but for now it's working ... so long as I don't <setxkbmap -option "">.
Last edited by redart (2026-05-01 12:26:33)
Offline
With https://wiki.archlinux.org/title/Udev#Examples
you can also Remap scancodes to another keycode. This is also persistent in console.
Offline
The present option mess would also bread caps:shift - it's either coming from some session configuration by your DE or an xorg configlet.
grep -ri caps /{etc,usr/share}/X11/xorg.conf*And try the behavior of
setxkbmap -option "caps:shift"on a clean option stack.
Offline
Thanks seth and ua4000. The remapping scancodes is probably above my pay grade
.
<grep -ri caps etc> didn't find anything.
The xmodmap method is persistent through logouts and reboot so I'll stick with that for the time being.
Thanks again for the help.
Offline
Fwiw, Xmodmap simply gets "reset" when you run setxkbmap, is the "Shift_L:swapcaps,lshift:swapcaps,shift:swapcaps" stuff there after a reboot/login?
Offline
The "Shift_L:swapcaps,lshift:swapcaps,shift:swapcaps" has been replaced with "terminate:ctrl_alt_bksp" !. looking back through my Terminal history I don't see any input for that so not sure where it's coming from.
It's also persistent. A "setxkbmap -option "" " will clear it, but then after logout or reboot it returns.
EDIT: found it in /etc/X11/xorg.conf.d/00-keyboard.conf
[tony@T550 xorg.conf.d]$ cat 00-keyboard.conf
# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# update this file.
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "gb"
Option "XkbModel" "pc105"
Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSectionLast edited by redart (2026-05-02 17:21:52)
Offline
That option is harmless, it just enables "zapping" (the shortcut to kill the X11 server)
Offline
Keyboard shortcut for Logout.....another trick learned ![]()
Last edited by redart (2026-05-02 17:46:43)
Offline
That's gonna be a hard "logout" ![]()
The shortcut is supposed to be a failsafe option/last resort.
Offline