Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 1968  / 3 Years ago, sat, july 10, 2021, 11:24:04

I can only set separately: switching layouts on caps lock or swap escape and caps lock keys, but has no success in trying to do it simultaneously. The final variant I want is to get caps lock behavior like escape key and use escape key for layout switching.



I have tried something like this:



setxkbmap -option grp:switch,grp:caps_toggle,grp_led:caps,caps:swapescape us,ru

More From » keyboard

 Answers
4

You should be able to swap around the keys with xmodmap if you can't quite do it with setxkbmap. You need the remove Lock modifier for caps lock, as it is a 'special' key.



remove Lock = Caps_Lock
keycode 66 = Escape NoSymbol
keycode 9 = Caps_Lock ISO_Next_Group


You could place the above in your ~/.Xmodmap, which is still read at startup if the correct command is in your ~/.xinitrc, as I explain further in this answer:





However, you cannot easily mix the xmodmap and setxkbmap commands, as the latter cancels out changes made with the former, as we discussed in the comments.



To execute these xmodmap commands in the terminal to test them, you would run, for example,



xmodmap -e "remove Lock = Caps_Lock"



but you would only place remove Lock = Caps_Lock in your ~/.Xmodmap file, as I explain further in my above linked answer.


[#35748] Sunday, July 11, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
llianconclad

Total Points: 65
Total Questions: 109
Total Answers: 127

Location: Mali
Member since Fri, Dec 3, 2021
2 Years ago
;