I want to put have the following behaviour for key with code 94:
by default it is '<'
with Shift it is '>'
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:
1)
xmodmap -e "keycode 94 mod1 = less greater bar"
- 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)?
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 '14 at 16:46