How is the syntax for
.XCompose for sequences containing modifier keys? The manpage says
(! MODIFIER ), but I did not manage to make it work. How is, e. g. the syntax for, let's say first AltGr and a, then b? I tried something like
(! mod5) <a> <b> which did not work.
Three things. First, if you're using modifier keys, no parentheses. The manpage just includes those to indicate that those portions of the syntax are optional.
Second, according to the man page:
MODIFIER may be one of Ctrl, Lock, Caps, Shift, Alt or Meta.
So, for example, I just made myself an XCompose shruggie having the shortcut
Ctrl+Alt+y with the line:
! Ctrl Alt <y>: "¯\\_(ツ)_/¯"
However, third, note that AltGr is not actually on the list of allowed modifiers. You probably want to set it as the Compose key instead, as described here.
After following that procedure, AltGr will be represented as
<Multi_key>, and so your
.XCompose line to produce a shruggie with the sequence
AltGr a b would be:
<Multi_key> <a> <b>: "¯\\_(ツ)_/¯"
Hope that helps.