as many others I don't need CapsLock. I want to reassign it such that it has the function of AltGr. I use Kubuntu 9.10 but I think there must be a solution which is distribution independent.

I already tried to use setxkbmap or xmodmap. Using xmodmap at least I managed that CapsLock to behaves like Del by following this description.

But I could not achieve assigning the AltGr behavior to CapsLock.

link|improve this question
feedback

2 Answers

Try one of these (substitute the keysim or keycode of your caps-lock key if it's different):

xmodmap -e "keysym 0xffe5 = Mode_switch"

or

xmodmap -e "keycode 66 = Mode_switch"
link|improve this answer
Thanks. Your line did not work directly for two reasons: 1. xmodmap wants a file so I have to pipe the string and read from stdin. 2. Mode_switch was successfully assigned but did not result in the 3rd level modifier. Then I played with xev again. When I realized that the string "Mode_switch" showes up there it was easy to press AltGr and look what one could read instead in the corresponding place. -> ISO_Level3_Shift. – basweber May 7 '10 at 14:38
@basweber: I forgot the -e option. I've edited my answer. – Dennis Williamson May 7 '10 at 15:13
Yes. Thats much cleaner than the piping approach. – basweber May 8 '10 at 20:20
feedback
up vote 1 down vote accepted

Based on Dennis' answer and by playing around with xev I found out that the magic phrase seems to be ISO_Level3_Shift.

At least this works for me:

xmodmap -e "keycode 66 = ISO_Level3_Shift"

Now I dont' run into danger to break my fingers while typing [, ], {, } and co on my german keyboard layout.

Edit: now using the -e option of xmodmap

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.