3

I try to configure my desired keyboard combination using setxkbmap but it seems some options are not compatible, because when I pass my desired options one of them has no affect.

I want both Left Shift and Right Shift to toggle Caps Lock, Caps Lock key as Alt Gr and Alt+Shift to switch layouts.

I was not able to have all together working while they work when I try them one by one. Can anybody give me the correct command?

This is the command that I have used:

setxkbmap -layout de,us,ir -option "lv3:caps_switch" -option "shift:both_capslock" -option "grp:alt_shift_toggle"
Artur Meinild
  • 21,605
  • 21
  • 56
  • 89
mehdix
  • 299
  • 1
  • 5
  • 21
  • I found that first holding down Shift key and then pressing Alt will work, but normally I press Alt+Shift not vice versa. – mehdix Jan 11 '14 at 13:54
  • As I told you in [my answer](http://askubuntu.com/a/403866/147044), see [How to use Alt+Shift to switch keyboard layouts in 13.10?](http://askubuntu.com/q/356357/147044) – Radu Rădeanu Jan 11 '14 at 14:11
  • The reason behind using setxkbmap is that it is reliable. I am not affected with mentioned bug in that Q&A and I can switch using keyboard settings. Because of too many keyboard related problems I decided to fall back to setxkbmap which I had used before and works perfectly. – mehdix Jan 11 '14 at 14:42

1 Answers1

2

To make both Shift keys together toggle Caps Lock (see the output of grep 'shift:both_capslock' /usr/share/X11/xkb/rules/xorg.lst command):

setxkbmap -option shift:both_capslock

To switch Caps Lock to Alt Gr:

xmodmap -e "keycode 66 = Alt_R Meta_R Alt_R Meta_R"

To switch layout using Alt+Shift keyboard shortcut, see the following post if you are using Ubuntu 13.10:

For Ubuntu 13.04 and older see:

Radu Rădeanu
  • 166,822
  • 48
  • 327
  • 400
  • Thanks Radu, but what I need is to set pressing both shift keys together to act as caps lock while the other options work as well. With setxkbmap this can be realized by -option "shift:both_capslock". – mehdix Jan 11 '14 at 13:48
  • @MahdiSadeghi You wasn't so clear in this sense... I just updated my answer. – Radu Rădeanu Jan 11 '14 at 14:09