Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Problem: I want to modify/redefine my keyboard layout (pc105 se) so that when I press certain keys with mod3 (super) and mod4 (hyper), a different character is returned than usual.


Keycode 61 produces 'minus' (-) when pressed normally and 'underscore' (_) when pressed with shift. When pressed with the first modifier group (AltGr) 'dead_belowdot' and 'dead_abovedot' is produced (without/with shift).

What I want is a left paranthesis or right paranthesis (without/with shift) when I press the key with the Super (win) key also pressed, and slash/backslash for the Hyper key (which I have configured to Caps Lock).

I have tried to add a .Xmodmap to my home directory and run it with xmodmap ~/.Xmodmap using the following syntax

keycode 61 = minus underscore a b c d e f g h i j k l m n o p

However, that will cause AltGr to result in c/d, while win/caps lock still only results in -/_

I have also tried modifying /usr/share/X11/xkb/symbols/se directly and tried the following changes:

key <BKSL>  { [apostrophe, asterisk, acute, multiply], [a,b,c,d], [e,f,g,h], [i,j,k,l]};

But all that happens is ' * ´ × ' * ' * (for normal, altgr, win and caps lock respectively). I have also tried

key <BKSL>  { [apostrophe, asterisk, acute, multiply, a,b,c,d, e,f,g,h, i,j,k,l]};

But as soon as there are more than four specified fields, it seems to break the key totaly, and the key reverts to default pc105 (us?) behaviour.

As I have failed to find anything on stackoverflow, superuser or google on how to deal with my scenario, I ask here.

This is my xmodmap -pm

xmodmap:  up to 3 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3        Hyper_L (0x42),  Hyper_L (0xcf)
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)
share|improve this question
If you find anything could you please post your answer here? (that is: answering your own question). I'm amazed by how complicated such a trivial task seems to be and there's hardly any info on the net. It's just crazy. –  Cedric Martin Aug 7 '12 at 18:33
I will. But for now, I'm still only at the stage of trial-and-error and constant manual reading. –  Aron Cederholm Aug 13 '12 at 11:49
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.