By default I have the following key mapping:
$ xmodmap -pke ... keycode 49 = oe OE oe OE leftdoublequotemark rightdoublequotemark leftdoublequotemark ... keycode 66 = Caps_Lock NoSymbol Caps_Lock ...
I assigned Ctlr to keycode 66 by doing
$ setxkbmap -option "ctrl:nocaps"
Now I'd like to assign Caps Lock to keycode 49.
$ printf "keycode 49 = Caps_Lock NoSymbol Caps_Lock" > ~/.Xmodmap $ xmodmap ~/.Xmodmap
The result was that pressing keycode 49 activates Caps Lock but pressing it again doesn't deactivate Caps Lock...
How could I toggle Caps Lock by pressing keycode 49?