Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to make a new keyboard layout in Linux that moves the modifier keys around. The problem is that this needs to be an xkb layout, because I still need to be able to switch to the Qwerty layout and the layout of my native language. Is there a way to write an xkb layout that works on the keycodes instead of the symbols?

That is, instead of this type of entry:

key <LCTL> { [ Control_L ] };

I would use this type of entry (doesn't work, just an example):

key keycode37 { [ Control_L ] };

I could then do something like put the Shift key where Alt was and move Alt to where the Windows key was:

key keycode133 { [ Alt_L ] };
key keycode64 { [ Shift_L ] };

I stress that using xmodmap clear mod* is not a good solution because that would prevent me from using any other keyboard layouts with the modifier keys in their standard positions.

share|improve this question

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.