10

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.

1 Answer 1

3

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.

1
  • 2
    ! Ctrl Alt <y>: "¯\\_(ツ)_/¯" completely ignored the modifiers. The shrug is printed when I press y by itself. Commented Jul 15, 2021 at 1:23

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.