How can I disable Caps Lock in a simple way under X11 when there is no key binding for it?
3
votes
2
answers
2051
views
I routinely disable Caps Lock and the respective modifier with a script, using
xmodmap
. That all works fine.
Sometimes, however, for some reason unknown, Caps Lock is active. Having no key bound to Caps_Lock
and no key bound to toggle the Lock
modifier, I cannot switch Caps Lock off unless I reset the keymap, press the key, then re-map it to my desired configuration.
So: **How can I disable Caps Lock (currently active) without re-mapping keys and with no keys bound to do the job?**
Perhaps a command line tool can set the state?
For anyone interested, here is how my script disables the accidental activation of Caps Lock by a key press (I never enable it intentionally):
#!/bin/sh
# I never want to use Caps_Lock. Make Caps_Lock another Control_L...
xmodmap -e "remove Lock = Caps_Lock" 2> /dev/null
xmodmap -e "keysym Caps_Lock = Control_L" 2> /dev/null
xmodmap -e "add Control = Control_L" 2> /dev/null
Asked by Ned64
(9256 rep)
Feb 28, 2020, 06:25 PM
Last activity: Jul 9, 2021, 08:23 PM
Last activity: Jul 9, 2021, 08:23 PM