<solved more or less> CapsLock & .Xmodmap headaches

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
sadhu
Level 5
Level 5
Posts: 862
Joined: Fri Nov 22, 2013 9:48 am
Location: Sri Lanka
Contact:

<solved more or less> CapsLock & .Xmodmap headaches

Post by sadhu »

On my laptop, i have the following .Xmodmap stored in ~/.local/share:

Code: Select all

keycode 58 = Shift_L Caps_Lock NoSymbol NoSymbol
pointer = 1 0 3 4 5 6 7 8 9 10 11 12 13 14 15 16
It works:
  • Line 1 causes CapsLock to act as the Shift key, and Shift-CapsLock actually toggles the CapsLock function
  • Line 2 disables the middle mouse button, which prevents me from pasting when I scroll through a long document.
It's when I get back to my desktop that problems arise. First, the mouse middle button is disabled, so therefore .Xmodmap is being read. However, I can't seem to get the caps lock to switch.

I'm using a Logitech K120 (standard US) keyboard. Showkeys yields

Code: Select all

keycode  58 press
keycode  58 release
Moreover, neither of the 2nd or 3rd selections on System Settings > Keyboard > Layouts > Options see to work: "Caps Lock acts as Shift with Locking..." I would like the third setting, where Shift pauses the caps lock function. But neither of these work. Bug?

I have two questions:

1) What must I do to get .Xmodmap to work?
2) Where can I find documentation for ALL of these selections on Keyboard Layout Options? Some of the others seem intriguing. (I hate experimenting; I'd rather just read the manual.)


Thanks

Sadhu
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: lm18.2-64-Cin CapsLock & .Xmodmap headaches

Post by deepakdeshp »

Code: Select all

man xmodmap
gives the manual for this utility. Similarly you can see man for the utilities at the see also section at the bottom of the man page
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
User avatar
sadhu
Level 5
Level 5
Posts: 862
Joined: Fri Nov 22, 2013 9:48 am
Location: Sri Lanka
Contact:

Re: lm18.2-64-Cin CapsLock & .Xmodmap headaches

Post by sadhu »

deepakdeshp wrote:

Code: Select all

man xmodmap
gives the manual for this utility. Similarly you can see man for the utilities at the see also section at the bottom of the man page
Yes, thanks, that helps for xmodmap. As it is, I used the command xmodmap -pke to a list of keys, and it turns out Caps_Lock is key 66, not 58 as shown by sudo showkey. After editing .Xmodmap as follows

Code: Select all

keycode  66 = Shift_L Caps_Lock NoSymbol Caps_Lock
pointer = 1 0 3 4 5 6 7 8 9 10 11 12 13 14 15 16
then running sudo xmodmap .Xmodmap, everything's working properly.

But the other questions remain: Where can I find a discussion about the keyboard layout options in the System Properties? Why did I have to edit .Xmodmap instead of just selecting items 2 or 3 on the Keyboard Layout Options window?

I'll mark it solved when I get answers to those two questions. ---because for a newbie or non-Linux guru, clicking checkboxes is much easier than playing around with xmodmap.

Thanks,

-Sadhu
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: lm18.2-64-Cin CapsLock & .Xmodmap headaches

Post by deepakdeshp »

This may help.
In a shell:

Code: Select all

man keyboard
sudo dpkg-reconfigure keyboard-configuration
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
Locked

Return to “Hardware Support”