I want to put have the following behaviour for key with code 94:

  1. by default it is '<'

  2. with Shift it is '>'

  3. with Alt it is '|'

I only managed to get the default and Shift behaviour by using command (names are from xev):

xmodmap -e "keycode 94 = less greater"

I tried three thing to all of the behaviour:


xmodmap -e "keycode 94 mod1 = less greater bar"
  1. xmodmap -e "keycode 94 shift mod1 = less greater bar"
xmodmap -e "keycode 94 = less greater"
xmodmap -e "add mod1 = less bar"

First two add the effect of having '<' by default and '|' with Shift . I'm not entirely sure what the third one did.

I also got the same behaviour as in 1) and 2) (Shift is relevant, Alt does nothing) from command:

xmodmap -e "keycode 94 mod1 = less bar"

My information is mostly based this answer (especially the bonus section).

How to map a single key to have a different default, shift and behaviour based on modifier(s)?

  • 1
    Maybe askubuntu.com/a/423245/16395 can help you. Notice that xmodmap is not recommended anymore in Ubuntu. You should use the more powerful (but a lot more complex) xkbd system... You can find links in the answer linked here
    – Rmano
    Feb 24, 2014 at 16:46

1 Answer 1


Just found out, heuristically ! Look at the following :

xmodmap -e "keycode 38 = a A aacute Aacute ae AE ae"

It's basically

  1. a: normal a
  2. A: shift + a
  3. á: altgr + a
  4. Á: shift + altgr + a
  5. æ: [some modifier combination] + a
  6. Æ: shift + [some modifier combination] + a
  7. æ: ???

So just reconfigure the key with the representations you want. For example, I reassigned period + altgr to interpunct (a bit expedient though):

xmodmap -e "keycode 60 = period greater 0x00b7 0x00b7 0x00b7 0x00b7"    
  • 1
    kind of old, but how do you choose/ find out which modifier activate 5. and 6.? i can't make them trigger
    – fogx
    Jun 12, 2019 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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