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

So I'm trying to create a combination of keys to generate ISO keys for the Portuguese layout, the key in question is the < >, pressing it will normally generate the < character, < > + Shift will generate the > character. So I'm trying to create a combination using xmodmap, and I want this to work for all the programs. I've been searching on Google and came up with this example for Control + P = Up:

xmodmap -e "keycode 33 = p P Up"

keycode 33 matches p, so where does Control come up in that command?

What I want is:

  • map Control + , to >
  • map Control + . to <
share|improve this question
Thanks, it looks better :) – Maxrunner Jun 29 '12 at 16:55
So yeah the control modifier isnt working...anyway what the position for the control? – Maxrunner Jul 9 '12 at 9:36
It's possible that the author removed his own answer because it wasn't correct. – cYrus Jul 16 '12 at 0:08
ok. So this isnt possible with the xmodmap? – Maxrunner Jul 17 '12 at 22:30

The example from the other question is wrong.

xmodmap -e "keycode 33 = p P Up"

normally means that pressing AltGr + p will result in Up.

More precisely it means that pressing Mode_switch + p will result in Up.

As the xmodmap man page states:

The first keysym is used when no modifier key is pressed in conjunction with
this key, the second with Shift, the third when the Mode_switch key is used
with this key and the fourth when both the Mode_switch and Shift keys are used.

It is possible to map different or additional (to AltGr) as the Mode_switch key, e.g. the right Ctrl key:

xmodmap -e "keycode 105 = Mode_switch Mode_switch"

The problem however is that the key then won't work as normal Ctrl key anymore.

share|improve this answer

Your Answer


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

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