compose: fix the description of modifiers in compose sequences

The Compose format has a feature which allows specifying certain
modifiers must (or must not) be present with a given keysym in the
sequence.

The grammar in imLcPrs.c and the Compose man page both do not match what
the code actually does (see the handling of the variables
`modifier_mask` and `modifier` in parseline() in imLcPrs.c, which are
eventually matched as `ev->state & modifier_mask == modifier`).

Also explicitly list the accepted modifier names, since they are
not standard (e.g. "Ctrl" instead of "Control").

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: James Cloos <cloos@jhcloos.com>
This commit is contained in:
Ran Benita 2015-02-03 13:23:50 -05:00 committed by James Cloos
parent 129f13f385
commit ddf3b09bb2
2 changed files with 12 additions and 9 deletions

View file

@ -88,16 +88,18 @@ comment at the end of the line:
.PP
Each event consists of a specified input keysym, and optional modifier states:
.RS
[\fIMODIFIER_LIST\fP] \fB<\fP\fIkeysym\fP\fB>\fP
[([\fB!\fP] ([\fB~\fP] \fIMODIFIER\fP)...) | \fBNone\fP] \fB<\fP\fIkeysym\fP\fB>\fP
.RE
.PP
Each modifier consists of a specified modifier and a state:
.RS
(\fB!\fP \fIMODIFIER\fP ) | \fBNone\fP
.RE
Modifiers may be preceded by a
If the modifier list is preceded by
.RB \*q "!" \*q
it must match exactly.
MODIFIER may be one of Ctrl, Lock, Caps, Shift, Alt or Meta.
Each modifier may be preceded by a
.RB \*q "~" \*q
character to indicate that the modifier must not be present.
character to indicate that the modifier must not be present. If
.RB \*q "None" \*q
is specified, no modifier may be present.
.PP
The result specifies a string, keysym, or both, that the X client receives
as input when the sequence of events is input:

View file

@ -68,8 +68,9 @@ static void parsestringfile(FILE *fp, Xim im, int depth);
* COMMENT ::= "#" {<any character except null or newline>}
* LHS ::= EVENT { EVENT }
* EVENT ::= [MODIFIER_LIST] "<" keysym ">"
* MODIFIER_LIST ::= ("!" {MODIFIER} ) | "None"
* MODIFIER ::= ["~"] modifier_name
* MODIFIER_LIST ::= (["!"] {MODIFIER} ) | "None"
* MODIFIER ::= ["~"] MODIFIER_NAME
* MODIFIER_NAME ::= ("Ctrl"|"Lock"|"Caps"|"Shift"|"Alt"|"Meta")
* RHS ::= ( STRING | keysym | STRING keysym )
* STRING ::= '"' { CHAR } '"'
* CHAR ::= GRAPHIC_CHAR | ESCAPED_CHAR