Page 1 of 1

swap control and caps lock

Posted: Thu Sep 24, 2020 10:10 pm
by spetey
Hi folks, I'm new to LXDE, via the Raspberry Pi. It looks great!

I will mostly use VNC to connect to my pi via a virtual desktop, but I can't seem to get any options in /etc/default/keyboard to work. I tried

Code: Select all

XKBOPTIONS="ctrl:swapcaps"
but that seems ignored (yes after reboot too). And when I put this in a terminal:

Code: Select all

setxkbmap -option "ctrl:swapcaps"
I get an error like

Code: Select all

Couldn't interpret _XKB_RULES_NAMES property
Any thoughts or help on this? Thanks in advance!

Re: swap control and caps lock

Posted: Sat Sep 26, 2020 1:46 pm
by edward
There is a command:

Code: Select all

xmodmap -pk
Reference: https://ictsolved.github.io/remap-key-in-linux/

Also see:

Code: Select all

man xmodmap
Hope this helps.

Re: swap control and caps lock

Posted: Sun Sep 27, 2020 6:15 am
by spetey
Thanks, I'll try it! The method I used seems to work fine for the "real" desktop, when it was connected to a monitor - but not for virtual desktops. I don't get why keyboard mappings depend on the display!

Re: swap control and caps lock

Posted: Thu Oct 01, 2020 12:08 pm
by edward
spetey wrote: Sun Sep 27, 2020 6:15 am Thanks, I'll try it! The method I used seems to work fine for the "real" desktop, when it was connected to a monitor - but not for virtual desktops. I don't get why keyboard mappings depend on the display!
That's probably by design. I've never actually used a virtual desktop/machine before.

Re: swap control and caps lock

Posted: Fri Oct 02, 2020 8:06 pm
by drooly
spetey wrote: Sun Sep 27, 2020 6:15 amI don't get why keyboard mappings depend on the display!
Well, the keyboard mappings for the display server depend on the display.
The keyboard mappings for the console do not!
The "X" in the application or environment variable name usually denotes that it's relevant to the X server, i.e. the GUI.
You can have a look at e.g. /etc/default/console-setup for non-X stuff.