summaryrefslogtreecommitdiff
path: root/specs/appB.xml
blob: 059374668932e2f79f324cf42543b0f541d2237e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">

<appendix id='Translation_Table_Syntax'>
<title>Translation Table Syntax</title>
<para><emphasis role='strong'>Notation</emphasis></para>

<para>
Syntax is specified in EBNF notation with the following conventions:
</para>

<informaltable frame='none'>
  <?dbfo keep-together="auto" ?>
  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
  <colspec colwidth='0.1*' colname='c1'/>
  <colspec colwidth='1.0*' colname='c2'/>
  <tbody>
    <row>
      <entry>[ a ]</entry>
      <entry>Means either nothing or &ldquo;a&rdquo;</entry>
    </row>
    <row>
      <entry>{ a }</entry>
      <entry>Means zero or more occurrences of &ldquo;a&rdquo;</entry>
    </row>
    <row>
      <entry>( a | b )</entry>
      <entry>Means either &ldquo;a&rdquo; or &ldquo;b&rdquo;</entry>
    </row>
    <row>
      <entry>\\n</entry>
      <entry>Is the newline character</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para>
All terminals are enclosed in double quotation marks ("&nbsp;").
Informal descriptions are enclosed in angle brackets (&lt; &gt;).
Syntax
</para>

<para>The syntax of a translation table is</para>
<informaltable frame='none'>
  <?dbfo keep-together="auto" ?>
  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
  <colspec colwidth='0.2*' colname='c1'/>
  <colspec colwidth='1.0*' colname='c2'/>
  <tbody>
    <row>
      <entry>translationTable</entry>
      <entry>= [ directive ] { production }</entry>
    </row>
    <row>
      <entry>directive</entry>
      <entry>= ( &ldquo;#replace&rdquo; | &ldquo;#override&rdquo; | &ldquo;#augment&rdquo; ) &ldquo;\\n&rdquo;</entry>
    </row>
    <row>
      <entry>production</entry>
      <entry>= lhs &ldquo;:&rdquo; rhs &ldquo;\\n&rdquo;</entry>
    </row>
    <row>
      <entry>lhs</entry>
      <entry>= ( event | keyseq ) { &ldquo;,&rdquo; (event | keyseq) }</entry>
    </row>
    <row>
      <entry>keyseq</entry>
      <entry>= &ldquo;"&rdquo; keychar {keychar} &ldquo;"&rdquo;</entry>
    </row>
    <row>
      <entry>keychar</entry>
      <entry>= [ &ldquo;^&rdquo; | &ldquo;$&rdquo; | &ldquo;\\&rdquo; ] &lt;ISO Latin 1 character&gt;</entry>
    </row>
    <row>
      <entry>event</entry>
      <entry>= [modifier_list] &ldquo;&lt;&rdquo;event_type&ldquo;&gt;&rdquo; [ &ldquo;(&rdquo; count[&ldquo;+&rdquo;] &ldquo;)&rdquo; ] {detail}</entry>
    </row>
    <row>
      <entry>modifier_list</entry>
      <entry>= ( [&ldquo;!&rdquo;] [&ldquo;:&rdquo;] {modifier} ) | &ldquo;None&rdquo;</entry>
    </row>
    <row>
      <entry>modifier</entry>
      <entry>= [&ldquo;~&rdquo;] modifier_name</entry>
    </row>
    <row>
      <entry>count</entry>
      <entry>= (&ldquo;1&rdquo; | &ldquo;2&rdquo; | &ldquo;3&rdquo; | &ldquo;4&rdquo; | ...)</entry>
    </row>
    <row>
      <entry>modifier_name</entry>
      <entry>= &ldquo;@&rdquo; &lt;keysym&gt; | &lt;see ModifierNames table below&gt;</entry>
    </row>
    <row>
      <entry>event_type</entry>
      <entry>= &lt;see Event Types table below&gt;</entry>
    </row>
    <row>
      <entry>detail</entry>
      <entry>= &lt;event specific details&gt;</entry>
    </row>
    <row>
      <entry>rhs</entry>
      <entry>= { name &ldquo;(&rdquo; [params] &ldquo;)&rdquo; }</entry>
    </row>
    <row>
      <entry>name</entry>
      <entry>= namechar { namechar }</entry>
    </row>
    <row>
      <entry>namechar</entry>
      <entry>= { &ldquo;a&rdquo;&ndash;&ldquo;z&rdquo; | &ldquo;A&rdquo;&ndash;&ldquo;Z&rdquo; | &ldquo;0&rdquo;&ndash;&ldquo;9&rdquo; | &ldquo;_&rdquo; | &ldquo;&ndash;&rdquo; }</entry>
    </row>
    <row>
      <entry>params</entry>
      <entry>= string {&ldquo;,&rdquo; string}</entry>
    </row>
    <row>
      <entry>string</entry>
      <entry>= quoted_string | unquoted_string</entry>
    </row>
    <row>
      <entry>quoted_string</entry>
      <entry>= <quote>"</quote> {&lt;Latin 1 character&gt; | escape_char} [&ldquo;\\"&rdquo; ] <quote>"</quote></entry>
    </row>
    <row>
      <entry>escape_char</entry>
      <entry>= &ldquo;\\"&rdquo;</entry>
    </row>
    <row>
      <entry>unquoted_string</entry>
      <entry>= {&lt;Latin 1 character except space, tab, &ldquo;,&rdquo;, &ldquo;\\n&rdquo;, &ldquo;)&rdquo;&gt;}</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para>
The <emphasis remap='I'>params</emphasis> field is parsed into a list of
<function>String</function>
values that will be passed to the named action procedure.  A
<emphasis remap='I'>quoted string</emphasis> may contain an embedded quotation mark if the
quotation mark is preceded by a single backslash (\).  The
three-character sequence &ldquo;\\"&rdquo; is interpreted as &ldquo;single backslash
followed by end-of-string&rdquo;.
</para>
<para><emphasis role='strong'>Modifier Names</emphasis></para>

<para>
The modifier field is used to specify standard X keyboard and button
modifier mask bits.
Modifiers are legal on event types
<function>KeyPress</function>,
<function>KeyRelease</function>,
<function>ButtonPress</function>,
<function>ButtonRelease</function>,
<function>MotionNotify</function>,
<function>EnterNotify</function>,
<function>LeaveNotify</function>,
and their abbreviations.
An error is generated when a translation table
that contains modifiers for any other events is parsed.
</para>

<itemizedlist spacing='compact'>
  <listitem>
    <para>
If the modifier list has no entries and is not &ldquo;None&rdquo;,
it means &ldquo;don't care&rdquo; on all modifiers.
    </para>
  </listitem>
  <listitem>
    <para>
If an exclamation point (!) is specified at the beginning
of the modifier list,
it means that the listed modifiers must be in the correct state
and no other modifiers can be asserted.
    </para>
  </listitem>
  <listitem>
    <para>
If any modifiers are specified
and an exclamation point (!) is not specified,
it means that the listed modifiers must be in the
correct state and &ldquo;don't care&rdquo; about any other modifiers.
    </para>
  </listitem>
  <listitem>
    <para>
If a modifier is preceded by a tilde (~),
it means that that modifier must not be asserted.
    </para>
  </listitem>
  <listitem>
    <para>
If &ldquo;None&rdquo; is specified, it means no modifiers can be asserted.
    </para>
  </listitem>
  <listitem>
    <para>
If a colon (:) is specified at the beginning of the modifier list,
it directs the Intrinsics to apply any standard modifiers in the
event to map the event keycode into a KeySym.
The default standard modifiers are Shift and Lock,
with the interpretation as defined in <emphasis remap='I'>X Window
System Protocol</emphasis>, Section 5.
The resulting KeySym must exactly match the specified
KeySym, and the nonstandard modifiers in the event must match the
modifier list.
For example, &ldquo;:&lt;Key&gt;a&rdquo; is distinct from &ldquo;:&lt;Key&gt;A&rdquo;,
and &ldquo;:Shift&lt;Key&gt;A&rdquo; is distinct from &ldquo;:&lt;Key&gt;A&rdquo;.
    </para>
  </listitem>
  <listitem>
    <para>
If both an exclamation point (!) and a colon (:) are specified at
the beginning of the modifier list, it means that the listed
modifiers must be in the correct state and that no other modifiers
except the standard modifiers can be asserted.  Any standard
modifiers in the event are applied as for colon (:) above.
    </para>
  </listitem>
  <listitem>
    <para>
If a colon (:) is not specified,
no standard modifiers are applied.
Then, for example, &ldquo;&lt;Key&gt;A&rdquo; and &ldquo;&lt;Key&gt;a&rdquo; are equivalent.
    </para>
  </listitem>
</itemizedlist>

<para>
In key sequences,
a circumflex (^) is an abbreviation for the Control modifier,
a dollar sign ($) is an abbreviation for Meta,
and a backslash (\) can be used to quote any
character, in particular a double quote ("), a circumflex (^),
a dollar sign ($), and another backslash (\).
Briefly:
</para>

<programlisting>
No modifiers:                   None &lt;event&gt; detail
Any modifiers:                  &lt;event&gt; detail
Only these modifiers:           ! mod1 mod2 &lt;event&gt; detail
These modifiers and any others: mod1 mod2 &lt;event&gt; detail
</programlisting>

<para>
The use of &ldquo;None&rdquo; for a modifier list is identical to the use
of an exclamation point with no modifers.
</para>

<informaltable frame='topbot'>
  <?dbfo keep-together="auto" ?>
  <tgroup cols='3' align='left' colsep='0' rowsep='0'>
  <colspec colwidth='1.0*' colname='c1'/>
  <colspec colwidth='1.0*' colname='c2'/>
  <colspec colwidth='1.0*' colname='c3'/>
  <thead>
    <row rowsep='1'>
      <entry>Modifier</entry>
      <entry>Abbreviation</entry>
      <entry>Meaning</entry>
    </row>
  </thead>
  <tbody>
    <row>
      <entry>Ctrl</entry>
      <entry>c</entry>
      <entry>Control modifier bit</entry>
    </row>
    <row>
      <entry>Shift</entry>
      <entry>s</entry>
      <entry>Shift modifier bit</entry>
    </row>
    <row>
      <entry>Lock</entry>
      <entry>l</entry>
      <entry>Lock modifier bit</entry>
    </row>
    <row>
      <entry>Meta</entry>
      <entry>m</entry>
      <entry>Meta key modifier</entry>
    </row>
    <row>
      <entry>Hyper</entry>
      <entry>h</entry>
      <entry>Hyper key modifier</entry>
    </row>
    <row>
      <entry>Super</entry>
      <entry>su</entry>
      <entry>Super key modifier</entry>
    </row>
    <row>
      <entry>Alt</entry>
      <entry>a</entry>
      <entry>Alt key modifier</entry>
    </row>
    <row>
      <entry>Mod1</entry>
      <entry></entry>
      <entry>Mod1 modifier bit</entry>
    </row>
    <row>
      <entry>Mod2</entry>
      <entry></entry>
      <entry>Mod2 modifier bit</entry>
    </row>
    <row>
      <entry>Mod3</entry>
      <entry></entry>
      <entry>Mod3 modifier bit</entry>
    </row>
    <row>
      <entry>Mod4</entry>
      <entry></entry>
      <entry>Mod4 modifier bit</entry>
    </row>
    <row>
      <entry>Mod5</entry>
      <entry></entry>
      <entry>Mod5 modifier bit</entry>
    </row>
    <row>
      <entry>Button1</entry>
      <entry></entry>
      <entry>Button1 modifier bit</entry>
    </row>
    <row>
      <entry>Button2</entry>
      <entry></entry>
      <entry>Button2 modifier bit</entry>
    </row>
    <row>
      <entry>Button3</entry>
      <entry></entry>
      <entry>Button3 modifier bit</entry>
    </row>
    <row>
      <entry>Button4</entry>
      <entry></entry>
      <entry>Button4 modifier bit</entry>
    </row>
    <row>
      <entry>Button5</entry>
      <entry></entry>
      <entry>Button5 modifier bit</entry>
    </row>
    <row>
      <entry>None</entry>
      <entry></entry>
      <entry>No modifiers</entry>
    </row>
    <row>
      <entry>Any</entry>
      <entry></entry>
      <entry>Any modifier combination</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para>
A key modifier is any modifier bit one of whose corresponding KeyCodes
contains the corresponding left or right KeySym.
For example,
&ldquo;m&rdquo; or &ldquo;Meta&rdquo; means any modifier bit mapping to a KeyCode
whose KeySym list contains XK_Meta_L or XK_Meta_R.
Note that this interpretation is for each display,
not global or even for each application context.
The Control, Shift, and Lock modifier names refer
explicitly to the corresponding modifier bits;
there is no additional interpretation of KeySyms for these modifiers.
</para>

<para>
Because it is possible to associate arbitrary KeySyms with modifiers, the set of
key modifiers is extensible.  The &ldquo;@&rdquo; &lt;keysym&gt; syntax means any
modifier bit whose corresponding KeyCode contains the specified KeySym name.
</para>

<para>
A modifier_list/KeySym combination in a translation matches a
modifiers/KeyCode combination in an event in the following ways:
</para>

<orderedlist>
  <listitem>
    <para>
If a colon (:) is used, the Intrinsics call the display's
<xref linkend='XtKeyProc' xrefstyle='select: title'/>
with the KeyCode and modifiers.
To match, (<emphasis remap='I'>modifiers</emphasis> &amp; ~<emphasis remap='I'>modifiers_return</emphasis>) must equal <emphasis remap='I'>modifier_list</emphasis>, and
<emphasis remap='I'>keysym_return</emphasis> must equal the given KeySym.
    </para>
  </listitem>
  <listitem>
    <para>
If (:) is not used, the Intrinsics mask off all don't-care bits from the
modifiers.
This value must be equal to <emphasis remap='I'>modifier_list</emphasis>.
Then, for each possible combination of
don't-care modifiers in the modifier list, the Intrinsics call the display's
<xref linkend='XtKeyProc' xrefstyle='select: title'/>
with the KeyCode and that combination ORed with the cared-about modifier bits
from the event.
<emphasis remap='I'>Keysym_return</emphasis> must match the KeySym in the translation.
    </para>
  </listitem>
</orderedlist>

<para><emphasis role='strong'>Event Types</emphasis></para>

<para>
The event-type field describes XEvent types.
In addition to the standard
Xlib symbolic event type names, the following event type synonyms
are defined:
</para>

<informaltable frame='topbot'>
  <?dbfo keep-together="auto" ?>
  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
  <colspec colwidth='1.0*' colname='c1'/>
  <colspec colwidth='1.0*' colname='c2'/>
  <thead>
    <row rowsep='1'>
      <entry>Type</entry>
      <entry>Meaning</entry>
    </row>
  </thead>
  <tbody>
    <row>
      <entry>Key</entry>
      <entry><function>KeyPress</function></entry>
    </row>
    <row>
      <entry>KeyDown</entry>
      <entry><function>KeyPress</function></entry>
    </row>
    <row>
      <entry>KeyUp</entry>
      <entry><function>KeyRelease</function></entry>
    </row>
    <row>
      <entry>BtnDown</entry>
      <entry><function>ButtonPress</function></entry>
    </row>
    <row>
      <entry>BtnUp</entry>
      <entry><function>ButtonRelease</function></entry>
    </row>
    <row>
      <entry>Motion</entry>
      <entry><function>MotionNotify</function></entry>
    </row>
    <row>
      <entry>PtrMoved</entry>
      <entry><function>MotionNotify</function></entry>
    </row>
    <row>
      <entry>MouseMoved</entry>
      <entry><function>MotionNotify</function></entry>
    </row>
    <row>
      <entry>Enter</entry>
      <entry><function>EnterNotify</function></entry>
    </row>
    <row>
      <entry>EnterWindow</entry>
      <entry><function>EnterNotify</function></entry>
    </row>
    <row>
      <entry>Leave</entry>
      <entry><function>LeaveNotify</function></entry>
    </row>
    <row>
      <entry>LeaveWindow</entry>
      <entry><function>LeaveNotify</function></entry>
    </row>
    <row>
      <entry>FocusIn</entry>
      <entry><function>FocusIn</function></entry>
    </row>
    <row>
      <entry>FocusOut</entry>
      <entry><function>FocusOut</function></entry>
    </row>
    <row>
      <entry>Keymap</entry>
      <entry><function>KeymapNotify</function></entry>
    </row>
    <row>
      <entry>Expose</entry>
      <entry><function>Expose</function></entry>
    </row>
    <row>
      <entry>GrExp</entry>
      <entry><function>GraphicsExpose</function></entry>
    </row>
    <row>
      <entry>NoExp</entry>
      <entry><function>NoExpose</function></entry>
    </row>
    <row>
      <entry>Visible</entry>
      <entry><function>VisibilityNotify</function></entry>
    </row>
    <row>
      <entry>Create</entry>
      <entry><function>CreateNotify</function></entry>
    </row>
    <row>
      <entry>Destroy</entry>
      <entry><function>DestroyNotify</function></entry>
    </row>
    <row>
      <entry>Unmap</entry>
      <entry><function>UnmapNotify</function></entry>
    </row>
    <row>
      <entry>Map</entry>
      <entry><function>MapNotify</function></entry>
    </row>
    <row>
      <entry>MapReq</entry>
      <entry><function>MapRequest</function></entry>
    </row>
    <row>
      <entry>Reparent</entry>
      <entry><function>ReparentNotify</function></entry>
    </row>
    <row>
      <entry>Configure</entry>
      <entry><function>ConfigureNotify</function></entry>
    </row>
    <row>
      <entry>ConfigureReq</entry>
      <entry><function>ConfigureRequest</function></entry>
    </row>
    <row>
      <entry>Grav</entry>
      <entry><function>GravityNotify</function></entry>
    </row>
    <row>
      <entry>ResReq</entry>
      <entry><function>ResizeRequest</function></entry>
    </row>
    <row>
      <entry>Circ</entry>
      <entry><function>CirculateNotify</function></entry>
    </row>
    <row>
      <entry>CircReq</entry>
      <entry><function>CirculateRequest</function></entry>
    </row>
    <row>
      <entry>Prop</entry>
      <entry><function>PropertyNotify</function></entry>
    </row>
    <row>
      <entry>SelClr</entry>
      <entry><function>SelectionClear</function></entry>
    </row>
    <row>
      <entry>SelReq</entry>
      <entry><function>SelectionRequest</function></entry>
    </row>
    <row>
      <entry>Select</entry>
      <entry><function>SelectionNotify</function></entry>
    </row>
    <row>
      <entry>Clrmap</entry>
      <entry><function>ColormapNotify</function></entry>
    </row>
    <row>
      <entry>Message</entry>
      <entry><function>ClientMessage</function></entry>
    </row>
    <row>
      <entry>Mapping</entry>
      <entry><function>MappingNotify</function></entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para>The supported abbreviations are:</para>

<informaltable frame='topbot'>
  <?dbfo keep-together="auto" ?>
  <tgroup cols='3' align='left' rowsep='0' colsep='0'>
  <colspec colwidth='1.0*' colname='c1'/>
  <colspec colwidth='1.0*' colname='c2'/>
  <colspec colwidth='1.0*' colname='c3'/>
  <thead>
    <row rowsep='1'>
      <entry>Abbreviation</entry>
      <entry>Event Type</entry>
      <entry>Including</entry>
    </row>
  </thead>
  <tbody>
    <row>
      <entry>Ctrl</entry>
      <entry><function>KeyPress</function></entry>
      <entry>with Control modifier</entry>
    </row>
    <row>
      <entry>Meta</entry>
      <entry><function>KeyPress</function></entry>
      <entry>with Meta modifier</entry>
    </row>
    <row>
      <entry>Shift</entry>
      <entry><function>KeyPress</function></entry>
      <entry>with Shift modifier</entry>
    </row>
    <row>
      <entry>Btn1Down</entry>
      <entry><function>ButtonPress</function></entry>
      <entry>with Button1 detail</entry>
    </row>
    <row>
      <entry>Btn1Up</entry>
      <entry><function>ButtonRelease</function></entry>
      <entry>with Button1 detail</entry>
    </row>
    <row>
      <entry>Btn2Down</entry>
      <entry><function>ButtonPress</function></entry>
      <entry>with Button2 detail</entry>
    </row>
    <row>
      <entry>Btn2Up</entry>
      <entry><function>ButtonRelease</function></entry>
      <entry>with Button2 detail</entry>
    </row>
    <row>
      <entry>Btn3Down</entry>
      <entry><function>ButtonPress</function></entry>
      <entry>with Button3 detail</entry>
    </row>
    <row>
      <entry>Btn3Up</entry>
      <entry><function>ButtonRelease</function></entry>
      <entry>with Button3 detail</entry>
    </row>
    <row>
      <entry>Btn4Down</entry>
      <entry><function>ButtonPress</function></entry>
      <entry>with Button4 detail</entry>
    </row>
    <row>
      <entry>Btn4Up</entry>
      <entry><function>ButtonRelease</function></entry>
      <entry>with Button4 detail</entry>
    </row>
    <row>
      <entry>Btn5Down</entry>
      <entry><function>ButtonPress</function></entry>
      <entry>with Button5 detail</entry>
    </row>
    <row>
      <entry>Btn5Up</entry>
      <entry><function>ButtonRelease</function></entry>
      <entry>with Button5 detail</entry>
    </row>
    <row>
      <entry>BtnMotion</entry>
      <entry><function>MotionNotify</function></entry>
      <entry>with any button modifier</entry>
    </row>
    <row>
      <entry>Btn1Motion</entry>
      <entry><function>MotionNotify</function></entry>
      <entry>with Button1 modifier</entry>
    </row>
    <row>
      <entry>Btn2Motion</entry>
      <entry><function>MotionNotify</function></entry>
      <entry>with Button2 modifier</entry>
    </row>
    <row>
      <entry>Btn3Motion</entry>
      <entry><function>MotionNotify</function></entry>
      <entry>with Button3 modifier</entry>
    </row>
    <row>
      <entry>Btn4Motion</entry>
      <entry><function>MotionNotify</function></entry>
      <entry>with Button4 modifier</entry>
    </row>
    <row>
      <entry>Btn5Motion</entry>
      <entry><function>MotionNotify</function></entry>
      <entry>with Button5 modifier</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para>
The detail field is event-specific and normally corresponds to the
detail field of the corresponding event as described
by <emphasis remap='I'>X Window System Protocol</emphasis>, Section 11.
The detail field is supported for the following event types:
</para>

<informaltable frame='none'>
  <?dbfo keep-together="auto" ?>
  <tgroup cols='2' align='left' rowsep='0' colsep='0'>
  <colspec colwidth='0.5*' colname='c1'/>
  <colspec colwidth='1.0*' colname='c2'/>
  <tbody>
    <row>
      <entry>KeyPress</entry>
      <entry>KeySym from event <emphasis>detail</emphasis> (keycode)</entry>
    </row>
    <row>
      <entry>KeyRelease</entry>
      <entry>KeySym from event <emphasis>detail</emphasis> (keycode)</entry>
    </row>
    <row>
      <entry>ButtonPress</entry>
      <entry>button from event <emphasis>detail</emphasis></entry>
    </row>
    <row>
      <entry>ButtonRelease</entry>
      <entry>button from event <emphasis>detail</emphasis></entry>
    </row>
    <row>
      <entry>MotionNotify</entry>
      <entry>event <emphasis>detail</emphasis></entry>
    </row>
    <row>
      <entry>EnterNotify</entry>
      <entry>event <emphasis>mode</emphasis></entry>
    </row>
    <row>
      <entry>LeaveNotify</entry>
      <entry>event <emphasis>mode</emphasis></entry>
    </row>
    <row>
      <entry>FocusIn</entry>
      <entry>event <emphasis>mode</emphasis></entry>
    </row>
    <row>
      <entry>FocusOut</entry>
      <entry>event <emphasis>mode</emphasis></entry>
    </row>
    <row>
      <entry>PropertyNotify</entry>
      <entry><emphasis>atom</emphasis></entry>
    </row>
    <row>
      <entry>SelectionClear</entry>
      <entry><emphasis>selection</emphasis></entry>
    </row>
    <row>
      <entry>SelectionRequest</entry>
      <entry><emphasis>selection</emphasis></entry>
    </row>
    <row>
      <entry>SelectionNotify</entry>
      <entry><emphasis>selection</emphasis></entry>
    </row>
    <row>
      <entry>ClientMessage</entry>
      <entry><emphasis>type</emphasis></entry>
    </row>
    <row>
      <entry>MappingNotify</entry>
      <entry><emphasis>request</emphasis></entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para>
If the event type is
<function>KeyPress</function>
or
<function>KeyRelease</function>,
the detail field
specifies a KeySym name in standard format which is matched against
the event as described above, for example, &lt;Key&gt;A.
</para>

<para>
For the
<function>PropertyNotify</function>,
<function>SelectionClear</function>,
<function>SelectionRequest</function>,
<function>SelectionNotify</function>,
and
<function>ClientMessage</function>
events the detail field is specified
as an atom name; for example, &lt;Message&gt;WM_PROTOCOLS.  For the
<function>MotionNotify</function>,
<function>EnterNotify</function>,
<function>LeaveNotify</function>,
<function>FocusIn</function>,
<function>FocusOut</function>,
and
<function>MappingNotify</function>
events, either the symbolic constants as defined by
<emphasis remap='I'>X Window
System Protocol</emphasis>, Section 11,
or the numeric values may be specified.
</para>

<para>
If no detail field is specified, then any value in the event detail is
accepted as a match.
</para>

<para>
A KeySym can be specified as any of the standard KeySym names,
a hexadecimal number prefixed with &ldquo;0x&rdquo; or &ldquo;0X&rdquo;,
an octal number prefixed with &ldquo;0&rdquo;, or a decimal number.
A KeySym expressed as a single digit is interpreted as the
corresponding Latin 1 KeySym, for example, &ldquo;0&rdquo; is the KeySym XK_0.
Other single character KeySyms are treated as literal constants from Latin 1,
for example, &ldquo;!&rdquo; is treated as 0x21.
Standard KeySym names are as defined in
<filename>&lt;X11/keysymdef.h&gt;</filename>
with the &ldquo;XK_&rdquo; prefix removed.
</para>

<para><emphasis role='strong'>Canonical Representation</emphasis></para>

<para>
Every translation table has a unique, canonical text representation. This
representation is passed to a widget's
<function>display_accelerator</function>
procedure to describe the accelerators installed on that widget.
The canonical representation of a translation table is (see also
&ldquo;Syntax&rdquo;)
</para>

<informaltable frame='none'>
  <?dbfo keep-together="auto" ?>
  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
  <colspec colwidth='0.2*' colname='c1'/>
  <colspec colwidth='1.0*' colname='c2'/>
  <tbody>
    <row>
      <entry>translationTable</entry>
      <entry>= { production }
      </entry>
    </row>
    <row>
      <entry>production</entry>
      <entry>= lhs &ldquo;:&rdquo; rhs &ldquo;\\n&rdquo;
      </entry>
    </row>
    <row>
      <entry>lhs</entry>
      <entry>=event { &ldquo;,&rdquo; event }
      </entry>
    </row>
    <row>
      <entry>event</entry>
      <entry>=[modifier_list] &ldquo;&lt;&rdquo;event_type&ldquo;&gt;&rdquo; [ &ldquo;(&rdquo; count[&ldquo;+&rdquo;] &ldquo;)&rdquo; ] {detail}
      </entry>
    </row>
    <row>
      <entry>modifier_list</entry>
      <entry>= [&ldquo;!&rdquo;] [&ldquo;:&rdquo;] {modifier}
      </entry>
    </row>
    <row>
      <entry>modifier</entry>
      <entry>= [&ldquo;~&rdquo;] modifier_name
      </entry>
    </row>
    <row>
      <entry>count</entry>
      <entry>=(&ldquo;1&rdquo; | &ldquo;2&rdquo; | &ldquo;3&rdquo; | &ldquo;4&rdquo; | ...)
      </entry>
    </row>
    <row>
      <entry>modifier_name</entry>
      <entry>= &ldquo;@&rdquo; &lt;keysym&gt; | &lt;see canonical modifier names below&gt;
      </entry>
    </row>
    <row>
      <entry>event_type</entry>
      <entry>= &lt;see canonical event types below&gt;
      </entry>
    </row>
    <row>
      <entry>detail</entry>
      <entry>=&lt;event-specific details&gt;
      </entry>
    </row>
    <row>
      <entry>rhs</entry>
      <entry>={ name &ldquo;(&rdquo; [params] &ldquo;)&rdquo; }
      </entry>
    </row>
    <row>
      <entry>name</entry>
      <entry>=namechar { namechar }
      </entry>
    </row>
    <row>
      <entry>namechar</entry>
      <entry>= { &ldquo;a&rdquo;&ndash;&ldquo;z&rdquo; | &ldquo;A&rdquo;&ndash;&ldquo;Z&rdquo; | &ldquo;0&rdquo;&ndash;&ldquo;9&rdquo; | &ldquo;_&rdquo; | &ldquo;-&rdquo; }
      </entry>
    </row>
    <row>
      <entry>params</entry>
      <entry>=string {&ldquo;,&rdquo; string}
      </entry>
    </row>
    <row>
      <entry>string</entry>
      <entry>=quoted_string
      </entry>
    </row>
    <row>
      <entry>quoted_string</entry>
      <entry>= <quote>"</quote> {&lt;Latin 1 character&gt; | escape_char} [&ldquo;\\"&rdquo; ] <quote>"</quote>
      </entry>
    </row>
    <row>
      <entry>escape_char</entry>
      <entry>= &ldquo;\\"&rdquo;
      </entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para>The canonical modifier names are</para>

<programlisting>
     Ctrl     Mod1         Button1
     Shift    Mod2         Button2
     Lock     Mod3         Button3
     Mod4     Button4
     Mod5     Button5
</programlisting>

<para>The canonical event types are</para>

<informaltable frame='none'>
  <?dbfo keep-together="auto" ?>
  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
  <colspec colwidth='1.0*' colname='c1'/>
  <colspec colwidth='1.0*' colname='c2'/>
  <tbody>
    <row>
      <entry>KeyPress</entry>
      <entry>KeyRelease</entry>
    </row>
    <row>
      <entry>ButtonPress</entry>
      <entry>ButtonRelease</entry>
    </row>
    <row>
      <entry>MotionNotify</entry>
      <entry>EnterNotify</entry>
    </row>
    <row>
      <entry>LeaveNotify</entry>
      <entry>FocusIn</entry>
    </row>
    <row>
      <entry>FocusOut</entry>
      <entry>KeymapNotify</entry>
    </row>
    <row>
      <entry>Expose</entry>
      <entry>GraphicsExpose,</entry>
    </row>
    <row>
      <entry>NoExpose</entry>
      <entry>VisibilityNotify</entry>
    </row>
    <row>
      <entry>CreateNotify</entry>
      <entry>DestroyNotify</entry>
    </row>
    <row>
      <entry>UnmapNotify</entry>
      <entry>MapNotify</entry>
    </row>
    <row>
      <entry>MapRequest</entry>
      <entry>ReparentNotify</entry>
    </row>
    <row>
      <entry>ConfigureNotify</entry>
      <entry>ConfigureRequest</entry>
    </row>
    <row>
      <entry>GravityNotify</entry>
      <entry>ResizeRequest</entry>
    </row>
    <row>
      <entry>CirculateNotify</entry>
      <entry>CirculateRequest</entry>
    </row>
    <row>
      <entry>PropertyNotify</entry>
      <entry>SelectionClear</entry>
    </row>
    <row>
      <entry>SelectionRequest</entry>
      <entry>SelectionNotify</entry>
    </row>
    <row>
      <entry>ColormapNotify</entry>
      <entry>ClientMessage</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para><emphasis role='strong'>Examples</emphasis></para>

<itemizedlist spacing='compact'>
  <listitem>
    <para>
Always put more specific events in the table before more general ones:
    </para>
<programlisting>
    Shift &lt;Btn1Down&gt; : twas()\n\
    &lt;Btn1Down&gt; : brillig()
</programlisting>
  </listitem>
  <listitem>
    <para>
For double-click on Button1 Up with Shift, use this specification:
    </para>
<programlisting>
Shift&lt;Btn1Up&gt;(2) : and()
</programlisting>
  </listitem>
  <listitem>
    <para>
This is equivalent to the following line with appropriate timers set
between events:
    </para>
<programlisting>
Shift&lt;Btn1Down&gt;,Shift&lt;Btn1Up&gt;,Shift&lt;Btn1Down&gt;,Shift&lt;Btn1Up&gt; : and()
</programlisting>
  </listitem>
  <listitem>
    <para>
For double-click on Button1 Down with Shift, use this specification:
    </para>
<programlisting>
Shift&lt;Btn1Down&gt;(2) : the()
</programlisting>
  </listitem>
  <listitem>
    <para>
This is equivalent to the following line with appropriate timers set
between events:
    </para>
<programlisting>
Shift&lt;Btn1Down&gt;,Shift&lt;Btn1Up&gt;,Shift&lt;Btn1Down&gt; : the()
</programlisting>
  </listitem>
  <listitem>
    <para>
Mouse motion is always discarded when it occurs between events in a table
where no motion event is specified:
    </para>
<programlisting>
&lt;Btn1Down&gt;,&lt;Btn1Up&gt; : slithy()
</programlisting>
    <para>
This is taken, even if the pointer moves a bit between the down and
up events.
Similarly, any motion event specified in a translation matches any number
of motion events.
If the motion event causes an action procedure to be invoked,
the procedure is invoked after each motion event.
    </para>
  </listitem>
  <listitem>
    <para>
If an event sequence consists of a sequence of events that is also a
noninitial subsequence of another translation,
it is not taken if it occurs in the context of the longer sequence.
This occurs mostly in sequences like the following:
    </para>
<programlisting>
&lt;Btn1Down&gt;,&lt;Btn1Up&gt; : toves()\n\
&lt;Btn1Up&gt; :  did()
</programlisting>
    <para>
The second translation is taken only if the button release is not
preceded by a button press or if there are intervening events between the
press and the release.
Be particularly aware of this when using the repeat notation, above,
with buttons and keys,
because their expansion includes additional events;
and when specifying motion events, because they are implicitly included
between any two other events.
In particular,
pointer motion and double-click translations cannot coexist in the same
translation table.
    </para>
  </listitem>
  <listitem>
    <para>
For single click on Button1 Up with Shift and Meta, use this specification:
    </para>
  </listitem>
  <listitem>
<programlisting>
Shift Meta &lt;Btn1Down&gt;, Shift Meta&lt;Btn1Up&gt;: gyre()
</programlisting>
  </listitem>
  <listitem>
    <para>
For multiple clicks greater or equal to a minimum number,
a plus sign (+) may be appended to the final (rightmost)
count in an event sequence.  The actions will be invoked
on the <emphasis remap='I'>count</emphasis>-th click and each subsequent one arriving
within the multi-click time interval.  For example:
    </para>
<programlisting>
Shift &lt;Btn1Up&gt;(2+) : and()
</programlisting>
  </listitem>
  <listitem>
    <para>
To indicate
<function>EnterNotify</function>
with any modifiers, use this specification:
    </para>
<programlisting>
&lt;Enter&gt; : gimble()
</programlisting>
  </listitem>
  <listitem>
    <para>
To indicate
<function>EnterNotify</function>
with no modifiers, use this specification:
    </para>
<programlisting>
None &lt;Enter&gt; : in()
</programlisting>
  </listitem>
  <listitem>
    <para>
To indicate
<function>EnterNotify</function>
with Button1 Down and Button2 Up and &ldquo;don't care&rdquo; about
the other modifiers, use this specification:
    </para>
<programlisting>
Button1 ~Button2 &lt;Enter&gt; : the()
</programlisting>
  </listitem>
  <listitem>
    <para>
To indicate
<function>EnterNotify</function>
with Button1 down and Button2 down exclusively, use this specification:
    </para>
<programlisting>
! Button1 Button2 &lt;Enter&gt; : wabe()
</programlisting>
    <para>
You do not need to use a tilde (~) with an exclamation point (!).
    </para>
  </listitem>
</itemizedlist>
</appendix>