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
xmodmap -e "keycode 94 = less greater"
I tried three thing to all of the behaviour:
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)?