I tried several things:
setxkbmap -option caps: return
setxkbmap -option caps: enter
I also tried to modify the file /usr/share/X11/xkb/symbols/pc
by:
"Key <CAPS> {[Enter]};"
But nothing worked.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI tried several things:
setxkbmap -option caps: return
setxkbmap -option caps: enter
I also tried to modify the file /usr/share/X11/xkb/symbols/pc
by:
"Key <CAPS> {[Enter]};"
But nothing worked.
Not sure if it helps (as not purely in setxkbmap
), but:
setxkbmap -option caps:none
xmodmap -e "keycode 66 = Linefeed"
Change back:
setxkbmap -option
xmodmap -e "keycode 66 = Caps_Lock"
You can check with something like:
xev | sed -ne '/^KeyPress/,/^$/p'
to get keycodes.
xmodmap -e "keycode 66 = Return"
to emulate a return key.
I also tried to modify the file
/usr/share/X11/xkb/symbols/pc
by:
"Key <CAPS> {[Enter]};"
But nothing worked.
Almost there... There is no such thing as Enter
. The keyword here is Return
so edit your /usr/share/X11/xkb/symbols/pc
like this (original line commented out with //
):
// key <CAPS> { [ Caps_Lock ] };
key <CAPS> { [ Return ] };
and then your CapsLock should act as Return.
For Gnome (and Ubuntu 18.04), you can use Gnome Tweak tool, and change it under Keyboard and Mouse settings. Click 'Additional Layout Options', and you will find settings for Caps Lock.