You are not logged in.

#1 2026-04-30 19:09:13

redart
Member
Registered: 2016-12-03
Posts: 19

[SOLVED] Make left Ctrl key act as Shift key

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

#2 2026-04-30 20:14:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,744

Re: [SOLVED] Make left Ctrl key act as Shift key

grep ctrl /usr/share/X11/xkb/rules/base.lst

You'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

#3 2026-04-30 22:52:53

redart
Member
Registered: 2016-12-03
Posts: 19

Re: [SOLVED] Make left Ctrl key act as Shift key

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

#4 2026-04-30 23:25:02

redart
Member
Registered: 2016-12-03
Posts: 19

Re: [SOLVED] Make left Ctrl key act as Shift key

OK....think I finally figured it out after some more googling.  Found the keycode for CapsLock (66) using

xmodmap -pke | grep Caps

Then created a .Xmodmap file in my home directory and added

keycode 66 = Shift_L

CapsLock now behaves like a Shift key smile

Offline

#5 2026-05-01 06:23:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,744

Re: [SOLVED] Make left Ctrl key act as Shift key

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

#6 2026-05-01 12:20:53

redart
Member
Registered: 2016-12-03
Posts: 19

Re: [SOLVED] Make left Ctrl key act as Shift key

Think I just found out why it might not be preferable wink
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:swapcaps

That 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:     gb

Only 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

#7 2026-05-01 12:48:23

ua4000
Member
Registered: 2015-10-14
Posts: 558

Re: [SOLVED] Make left Ctrl key act as Shift key

With https://wiki.archlinux.org/title/Udev#Examples
you can also Remap scancodes to another keycode. This is also persistent in console.

Offline

#8 2026-05-01 16:53:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,744

Re: [SOLVED] Make left Ctrl key act as Shift key

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

#9 2026-05-01 17:53:28

redart
Member
Registered: 2016-12-03
Posts: 19

Re: [SOLVED] Make left Ctrl key act as Shift key

Thanks seth and ua4000.  The remapping scancodes is probably above my pay grade wink.   
<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

#10 2026-05-01 17:55:56

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,744

Re: [SOLVED] Make left Ctrl key act as Shift key

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

#11 2026-05-02 17:13:04

redart
Member
Registered: 2016-12-03
Posts: 19

Re: [SOLVED] Make left Ctrl key act as Shift key

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"
EndSection

Last edited by redart (2026-05-02 17:21:52)

Offline

#12 2026-05-02 17:33:57

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,744

Re: [SOLVED] Make left Ctrl key act as Shift key

That option is harmless, it just enables "zapping" (the shortcut to kill the X11 server)

Offline

#13 2026-05-02 17:46:26

redart
Member
Registered: 2016-12-03
Posts: 19

Re: [SOLVED] Make left Ctrl key act as Shift key

Keyboard shortcut for Logout.....another trick learned smile

Last edited by redart (2026-05-02 17:46:43)

Offline

#14 2026-05-02 18:04:41

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,744

Re: [SOLVED] Make left Ctrl key act as Shift key

That's gonna be a hard "logout" wink
The shortcut is supposed to be a failsafe option/last resort.

Offline

Board footer

Powered by FluxBB