HOw do I turn off the CAPS LOCK when the key is pressed?
it's currently set to turn off on release
41 Answer
tl;dr, untested automated way:
xkbcomp -xkb $DISPLAY $HOME/keyboardKeys
sed -iE 's/^key <CAPS> \{[^\n]+/key <CAPS> { repeat=no, type[group1]="ALPHABETIC", symbols[group1]=[ Caps_Lock, Caps_Lock ], actions[group1]=[ LockMods(modifiers=Lock), Private(type=3,data[0]=1,data[1]=3,data[2]=3) ] };/' "$HOME/keyboardKeys"
xkbcomp $HOME/keyboardKeys $DISPLAY
echo 'xkbcomp $HOME/keyboardKeys $DISPLAY' >> .profileOtherwise, read on.
See if this helps:
Open the terminal and execute:
xkbcomp -xkb $DISPLAY $HOME/keyboardKeys
This will export the current keyboard settings.
Then open the text file, search for a line with:key <CAPS> {
Replace it with:key <CAPS> { repeat=no, type[group1]="ALPHABETIC", symbols[group1]=[ Caps_Lock, Caps_Lock ], actions[group1]=[ LockMods(modifiers=Lock), Private(type=3,data[0]=1,data[1]=3,data[2]=3) ] };
Save and close the file.
Now, to temporarily apply that change run this command:
xkbcomp $HOME/keyboardKeys $DISPLAY
I don't know any way to apply this permanently but you may reapply this file change very time your session starts. For that, you can, for example, add that command to the .profile file in your $HOME directory, for example, like so:
echo 'xkbcomp $HOME/keyboardKeys $DISPLAY' >> .profile
Source: