ch04.xml revision e9fcaa8a
1<chapter id='xkb_events'> 2<title>Xkb Events</title> 3 4<para> 5The primary way the X server communicates with clients is by sending X events 6to them. Some events are sent to all clients, while others are sent only to 7clients that have requested them. Some of the events that can be requested are 8associated with a particular window and are only sent to those clients who have 9both requested the event and specified the window in which the event occurred. 10</para> 11 12 13<para> 14The Xkb extension uses events to communicate the keyboard status to interested 15clients. These events are not associated with a particular window. Instead, all 16Xkb keyboard status events are reported to all interested clients, regardless 17of which window currently has the keyboard focus and regardless of the grab 18state of the keyboard.<footnote><para>The one exception to this rule is the 19XkbExtensionDeviceNotify event report that is sent when a client attempts to 20use an unsupported feature of an X Input Extension device (see section 21.4). 21</para></footnote> <!-- xref --> 22</para> 23 24 25<para> 26The X server reports the events defined by the Xkb extension to your client 27application only if you have requested them. You may request Xkb events by 28calling either <emphasis> 29XkbSelectEvents</emphasis> 30 or <emphasis> 31XkbSelectEventDetails</emphasis> 32. <emphasis> 33XkbSelectEvents</emphasis> 34 requests Xkb events by their event type and causes them to be reported to your 35client application under all circumstances. You can specify a finer granularity 36for event reporting by using <emphasis> 37XkbSelectEventDetails</emphasis> 38; in this case events are reported only when the specific detail conditions you 39specify have been met. 40</para> 41 42<sect1 id='xkb_event_types'> 43<title>Xkb Event Types</title> 44 45<para> 46The Xkb Extension adds new event types to the X protocol definition. An Xkb 47event type is defined by two fields in the X event data structure. One is the 48<emphasis> 49type</emphasis> 50 field, containing the <emphasis> 51base event code.</emphasis> 52 This base event code is a value the X server assigns to each X extension at 53runtime and thatidentifies the extension that generated the event; thus, the 54event code in the <emphasis> 55type</emphasis> 56 field identifies the event as an Xkb extension event, rather than an event 57from another extension or a core X protocol event. You can obtain the base 58event code via a call to <emphasis> 59XkbQueryExtension</emphasis> 60 or <emphasis> 61XkbOpenDisplay</emphasis> 62. The second field is the Xkb event type, which contains a value uniquely 63identifying each different Xkb event type. Possible values are defined by 64constants declared in the header file <X11/extensions/Xkb.h>. 65</para> 66 67 68<para> 69Table 4.1 lists the categories of events defined by Xkb and their associated 70event types, as defined in <emphasis> 71Xkb.h</emphasis> 72. Each event is described in more detail in the section referenced for that 73event. 74</para> 75 76<table frame='none'> 77<title>Xkb Event Types</title> 78<tgroup cols='4'> 79<colspec colsep='0'/> 80<colspec colsep='0'/> 81<colspec colsep='0'/> 82<colspec colsep='0'/> 83<thead> 84<row rowsep='0'> 85 <entry>Event Type</entry> 86 <entry>Conditions Generating Event</entry> 87 <entry>Section</entry> 88 <entry>Page</entry> 89</row> 90</thead> 91<tbody> 92<row rowsep='0'> 93 <entry> 94 <para><emphasis>XkbNewKeyboardNotify</emphasis></para> 95 </entry> 96 <entry> 97 <para>Keyboard geometry; keycode range change</para> 98 </entry> 99 <entry> 100 <para>19</para> 101 </entry> 102 <entry> 103 <para>187</para> 104 </entry> 105</row> 106<row rowsep='0'> 107 <entry> 108 <para> 109 <emphasis>XkbMapNotify</emphasis> 110 </para> 111 </entry> 112 <entry> 113 <para>Keyboard mapping change</para> 114 </entry> 115 <entry> 116 <para>14.4</para> 117 </entry> 118 <entry> 119 <para>122</para> 120 </entry> 121</row> 122<row rowsep='0'> 123 <entry> 124 <para><emphasis>XkbStateNotify</emphasis></para> 125 </entry> 126 <entry> 127 <para>Keyboard state change</para> 128 </entry> 129 <entry> 130 <para>5.4</para> 131 </entry> 132 <entry> 133 <para>25</para> 134 </entry> 135</row> 136<row rowsep='0'> 137 <entry> 138 <para><emphasis>XkbControlsNotify</emphasis></para> 139 </entry> 140 <entry> 141 <para>Keyboard controls state change</para> 142 </entry> 143 <entry> 144 <para>10.11</para> 145 </entry> 146 <entry> 147 <para>79</para> 148 </entry> 149</row> 150<row rowsep='0'> 151 <entry> 152 <para><emphasis>XkbIndicatorStateNotify</emphasis></para> 153 </entry> 154 <entry> 155 <para>Keyboard indicators state change</para> 156 </entry> 157 <entry> 158 <para>8.5</para> 159 </entry> 160 <entry> 161 <para>45</para> 162 </entry> 163</row> 164<row rowsep='0'> 165 <entry> 166 <para><emphasis>XkbIndicatorMapNotify</emphasis></para> 167 </entry> 168 <entry> 169 <para>Keyboard indicators map change</para> 170 </entry> 171 <entry> 172 <para>8.5</para> 173 </entry> 174 <entry> 175 <para>45</para> 176 </entry> 177</row> 178<row rowsep='0'> 179 <entry> 180 <para><emphasis>XkbNamesNotify</emphasis></para> 181 </entry> 182 <entry> 183 <para>Keyboard name change</para> 184 </entry> 185 <entry> 186 <para>18.5</para> 187 </entry> 188 <entry> 189 <para>185</para> 190 </entry> 191</row> 192<row rowsep='0'> 193 <entry> 194 <para><emphasis>XkbCompatMapNotify</emphasis></para> 195 </entry> 196 <entry> 197 <para>Keyboard compatibility map change</para> 198 </entry> 199 <entry> 200 <para>17.5</para> 201 </entry> 202 <entry> 203 <para>178</para> 204 </entry> 205</row> 206<row rowsep='0'> 207 <entry> 208 <para><emphasis>XkbBellNotify</emphasis></para> 209 </entry> 210 <entry> 211 <para>Keyboard bell generated</para> 212 </entry> 213 <entry> 214 <para>9.4</para> 215 </entry> 216 <entry> 217 <para>52</para> 218 </entry> 219</row> 220<row rowsep='0'> 221 <entry> 222 <para><emphasis>XkbActionMessage</emphasis></para> 223 </entry> 224 <entry> 225 <para>Keyboard action message</para> 226 </entry> 227 <entry> 228 <para>16.1.11</para> 229 </entry> 230 <entry> 231 <para>155</para> 232 </entry> 233</row> 234<row rowsep='0'> 235 <entry> 236 <para><emphasis>XkbAccessXNotify</emphasis></para> 237 </entry> 238 <entry> 239 <para>AccessX state change</para> 240 </entry> 241 <entry> 242 <para>10.6.4</para> 243 </entry> 244 <entry> 245 <para>65</para> 246 </entry> 247</row> 248<row rowsep='0'> 249 <entry> 250 <para><emphasis>XkbExtensionDeviceNotify</emphasis></para> 251 </entry> 252 <entry> 253 <para>Extension device change</para> 254 </entry> 255 <entry> 256 <para>21.6</para> 257 </entry> 258 <entry> 259 <para>207</para> 260 </entry> 261</row> 262</tbody> 263</tgroup> 264</table> 265 266</sect1> 267<sect1 id='xkb_event_data_structures'> 268<title>Xkb Event Data Structures</title> 269 270<para> 271Xkb reports each event it generates in a unique structure holding the data 272values needed to describe the conditions the event is reporting. However, all 273Xkb events have certain things in common. These common features are contained 274in the same fields at the beginning of all Xkb event structures and are 275described in the <emphasis> 276XkbAnyEvent</emphasis> 277 structure: 278</para> 279 280<para><programlisting> 281typedef struct { 282 int type; /* Xkb extension base event code */ 283 unsigned long serial; /* X server serial number for event */ 284 Bool send_event; /* <emphasis> True</emphasis> => synthetically generated */ 285 Display * display; /* server connection where event 286generated */ 287 Time time; /* server time when event generated */ 288 int xkb_type; /* Xkb minor event code */ 289 unsigned int device; /* Xkb device ID, will not be 290 <emphasis>XkbUseCoreKbd</emphasis> */ 291} <emphasis>XkbAnyEvent</emphasis> 292; 293</programlisting></para> 294 295<para> 296For any Xkb event, the <emphasis> 297type</emphasis> 298 field is set to the base event code for the Xkb extension, assigned by the 299server to all Xkb extension events. The <emphasis> 300serial</emphasis> 301, <emphasis> 302send_event</emphasis> 303, and <emphasis> 304display</emphasis> 305 fields are as described for all X11 events. The <emphasis> 306time</emphasis> 307 field is set to the time when the event was generated and is expressed in 308milliseconds. The <emphasis> 309xkb_type</emphasis> 310 field contains the minor extension event code, which is the extension event 311type, and is one of the values listed in Table 4.1. The <emphasis> 312device</emphasis> 313 field contains the keyboard device identifier associated with the event. This 314is never <emphasis> 315XkbUseCoreKbd</emphasis> 316, even if the request that generated the event specified a device of <emphasis> 317XkbUseCoreKbd</emphasis> 318. If the request that generated the event specified <emphasis> 319XkbUseCoreKbd</emphasis> 320, <emphasis> 321device</emphasis> 322 contains a value assigned by the server to specify the core keyboard. If the 323request that generated the event specified an X input extension device, 324<emphasis> 325device</emphasis> 326 contains that same identifier. 327</para> 328 329 330<para> 331Other data fields specific to individual Xkb events are described in subsequent 332chapters where the events are described. 333</para> 334 335 336</sect1> 337<sect1 id='selecting_xkb_events'> 338<title>Selecting Xkb Events</title> 339 340<para> 341Xkb events are selected using an event mask, much the same as normal core X 342events are selected. However, unlike selecting core X events, where you must 343specify the selection status (on or off) for all possible event types whenever 344you wish to change the selection criteria for any one event, Xkb allows you to 345restrict the specification to only the event types you wish to change. This 346means that you do not need to remember the event selection values for all 347possible types each time you want to change one of them. 348</para> 349 350 351<para> 352Many Xkb event types are generated under several different circumstances. When 353selecting to receive an Xkb event, you may specify either that you want it 354delivered under all circumstances, or that you want it delivered only for a 355subset of the possible circumstances. 356</para> 357 358<para> 359You can also deselect an event type that was previously selected for, using the 360same granularity. 361</para> 362 363<para> 364Xkb provides two functions to select and deselect delivery of Xkb events. 365<emphasis> 366XkbSelectEvents</emphasis> 367 allows you to select or deselect delivery of more than one Xkb event type at 368once. Events selected using <emphasis> 369XkbSelectEvents</emphasis> 370 are delivered to your program under all circumstances that generate the 371events. To restrict delivery of an event to a subset of the conditions under 372which it occurs, use <emphasis> 373XkbSelectEventDetails</emphasis> 374. <emphasis> 375XkbSelectEventDetails</emphasis> 376 only allows you to change the selection conditions for a single event at a 377time, but it provides a means of fine-tuning the conditions under which the 378event is delivered. 379</para> 380 381 382<para> 383To select and / or deselect for delivery of one or more Xkb events and have 384them delivered under all conditions, use <emphasis> 385XkbSelectEvents</emphasis> 386. 387</para> 388 389<informaltable frame='none'> 390<tgroup cols='1'> 391<colspec colsep='0'/> 392<tbody> 393 <row rowsep='0'> 394 <entry role='functiondecl'> 395Bool <emphasis> 396XkbSelectEvents</emphasis> 397(<emphasis> 398display, device_spec, bits_to_change, values_for_bits</emphasis> 399) 400 </entry> 401 </row> 402 <row rowsep='0'> 403 <entry role='functionargdecl'> 404Display * <emphasis> 405display</emphasis> 406; /* connection to the X server */ 407 </entry> 408 </row> 409 <row rowsep='0'> 410 <entry role='functionargdecl'> 411unsigned int <emphasis> 412device_spec</emphasis> 413; /* device ID, or <emphasis> 414XkbUseCoreKbd</emphasis> 415 */ 416 </entry> 417 </row> 418 <row rowsep='0'> 419 <entry role='functionargdecl'> 420unsigned long int <emphasis> 421bits_to_change; </emphasis> 422/* determines events to be selected / deselected */ 423 </entry> 424 </row> 425 <row rowsep='0'> 426 <entry role='functionargdecl'> 427unsigned long int <emphasis> 428values_for_bits</emphasis> 429; /* 1=>select, 0->deselect; for events in <emphasis> 430bits_to_change</emphasis> 431 */ 432 </entry> 433</row> 434</tbody> 435</tgroup> 436</informaltable> 437 438<para> 439This request changes the Xkb event selection mask for the keyboard specified by 440<emphasis> 441device_spec</emphasis> 442. 443</para> 444 445 446<para> 447Each Xkb event that can be selected is represented by a bit in the <emphasis> 448bits_to_change</emphasis> 449 and <emphasis> 450values_for_bits</emphasis> 451 masks. Only the event selection bits specified by the <emphasis> 452bits_to_change</emphasis> 453 parameter are affected; any unspecified bits are left unchanged. To turn on 454event selection for an event, set the bit for the event in the <emphasis> 455bits_to_change</emphasis> 456 parameter and set the corresponding bit in the <emphasis> 457values_for_bits</emphasis> 458 parameter. To turn off event selection for an event, set the bit for the event 459in the <emphasis> 460bits_to_change</emphasis> 461 parameter and do not set the corresponding bit in the <emphasis> 462values_for_bits</emphasis> 463 parameter. The valid values for both of these parameters are an inclusive 464bitwise OR of the masks shown in Table 4.2. There is no interface to return 465your client’s current event selection mask. Clients cannot set other 466clients’ event selection masks. 467</para> 468 469 470<para> 471If a bit is not set in the <emphasis> 472bits_to_change</emphasis> 473 parameter, but the corresponding bit is set in the <emphasis> 474values_for_bits</emphasis> 475 parameter, a <emphasis> 476BadMatch</emphasis> 477 protocol error results. If an undefined bit is set in either the <emphasis> 478bits_to_change</emphasis> 479 or the <emphasis> 480values_for_bits</emphasis> 481 parameter, a <emphasis> 482BadValue</emphasis> 483 protocol error results. 484</para> 485 486 487<para> 488All event selection bits are initially zero for clients using the Xkb 489extension. Once you set some bits, they remain set for your client until you 490clear them via another call to <emphasis> 491XkbSelectEvents</emphasis> 492. 493</para> 494 495 496<para> 497<emphasis> 498XkbSelectEvents</emphasis> 499 returns <emphasis> 500False</emphasis> 501 if the Xkb extension has not been initilialized and <emphasis> 502True</emphasis> 503 otherwise. 504</para> 505 506 507<para> 508To select or deselect for a specific Xkb event and optionally place conditions 509on when events of that type are reported to your client, use <emphasis> 510XkbSelectEventDetails</emphasis> 511. This allows you to exercise a finer granularity of control over delivery of 512Xkb events with <emphasis> 513XkbSelectEvents</emphasis> 514. 515</para> 516 517 518<informaltable frame='none'> 519<tgroup cols='1'> 520<colspec colsep='0'/> 521<tbody> 522 <row rowsep='0'> 523 <entry role='functiondecl'> 524Bool <emphasis> 525XkbSelectEventDetails</emphasis> 526(<emphasis> 527display, device_spec, event_type, bits_to_change</emphasis> 528, <emphasis> 529values_for_bits</emphasis> 530) 531 </entry> 532 </row> 533 <row rowsep='0'> 534 <entry role='functionargdecl'> 535Display * <emphasis> 536display</emphasis> 537; /* connection to the X server */ 538 </entry> 539 </row> 540 <row rowsep='0'> 541 <entry role='functionargdecl'> 542unsigned int <emphasis> 543device_spec</emphasis> 544; /* device ID, or <emphasis> 545XkbUseCoreKbd</emphasis> 546 */ 547 </entry> 548 </row> 549 <row rowsep='0'> 550 <entry role='functionargdecl'> 551unsigned int <emphasis> 552event_type</emphasis> 553; /* Xkb event type of interest */ 554 </entry> 555 </row> 556 <row rowsep='0'> 557 <entry role='functionargdecl'> 558unsigned long int <emphasis> 559bits_to_change</emphasis> 560; /* event selection details */ 561 </entry> 562 </row> 563 <row rowsep='0'> 564 <entry role='functionargdecl'> 565unsigned long int <emphasis> 566values_for_bits</emphasis> 567; /* values for bits selected by <emphasis> 568bits_to_change</emphasis> 569 */ 570 </entry> 571</row> 572</tbody> 573</tgroup> 574</informaltable> 575 576<para> 577While <emphasis> 578XkbSelectEvents</emphasis> 579 allows multiple events to be selected, <emphasis> 580XkbSelectEventDetails</emphasis> 581 changes the selection criteria for a single type of Xkb event. The 582interpretation of the <emphasis> 583bits_to_change</emphasis> 584 and <emphasis> 585values_for_bits</emphasis> 586 masks depends on the event type in question. 587</para> 588 589 590<para> 591<emphasis> 592XkbSelectEventDetails</emphasis> 593 changes the Xkb event selection mask for the keyboard specified by <emphasis> 594device_spec</emphasis> 595 and the Xkb event specified by <emphasis> 596event_type</emphasis> 597. To turn on event selection for an event detail, set the bit for the detail in 598the <emphasis> 599bits_to_change</emphasis> 600 parameter and set the corresponding bit in the <emphasis> 601values_for_bits</emphasis> 602 parameter. To turn off event detail selection for a detail, set the bit for 603the detail in the <emphasis> 604bits_to_change</emphasis> 605 parameter and do not set the corresponding bit in the <emphasis> 606values_for_bits</emphasis> 607 parameter. 608</para> 609 610 611<para> 612If an invalid event type is specified, a <emphasis> 613BadValue</emphasis> 614 protocol error results. If a bit is not set in the <emphasis> 615bits_to_change</emphasis> 616 parameter, but the corresponding bit is set in the <emphasis> 617values_for_bits</emphasis> 618 parameter, a <emphasis> 619BadMatch</emphasis> 620 protocol error results. If an undefined bit is set in either the <emphasis> 621bits_to_change</emphasis> 622 or the <emphasis> 623values_for_bits</emphasis> 624 parameter, a <emphasis> 625BadValue</emphasis> 626 protocol error results. 627</para> 628 629 630<para> 631For each type of Xkb event, the legal event details that you can specify in the 632<emphasis> 633XkbSelectEventDetails</emphasis> 634 request are listed in the chapters that describe each event in detail. 635</para> 636 637 638<sect2 id='event_masks'> 639<title>Event Masks</title> 640 641<para> 642The X server reports the events defined by Xkb to your client application only 643if you have requested them via a call to <emphasis> 644XkbSelectEvents</emphasis> 645 or <emphasis> 646XkbSelectEventDetails</emphasis> 647. Specify the event types in which you are interested in a mask, as described 648in section 4.3. 649</para> 650 651 652<para> 653Table 4.2 lists the event mask constants that can be specified with the <!-- xref --> 654<emphasis> 655XkbSelectEvents</emphasis> 656 request and the circumstances in which the mask should be specified. 657</para> 658 659<table frame='none'> 660<title>XkbSelectEvents Mask Constants</title> 661<tgroup cols='3'> 662<colspec colsep='0'/> 663<colspec colsep='0'/> 664<colspec colsep='0'/> 665<thead> 666<row rowsep='0'> 667 <entry>Event Mask</entry> 668 <entry>Value</entry> 669 <entry>Notification Wanted</entry> 670</row> 671</thead> 672<tbody> 673 <row rowsep='0'> 674 <entry> 675<emphasis>XkbNewKeyboardNotifyMask</emphasis> 676 </entry> 677 <entry>(1L<<0)</entry> 678 <entry>Keyboard geometry change</entry> 679 </row> 680 <row rowsep='0'> 681 <entry> 682 <emphasis>XkbMapNotifyMask</emphasis> 683 </entry> 684 <entry>(1L<<1)</entry> 685 <entry>Keyboard mapping change</entry> 686 </row> 687 <row rowsep='0'> 688 <entry> 689<para><emphasis>XkbStateNotifyMask</emphasis></para> 690 </entry> 691 <entry>(1L<<2)</entry> 692 <entry><para>Keyboard state change</para></entry> 693 </row> 694 <row rowsep='0'> 695 <entry> 696<para><emphasis>XkbControlsNotifyMask</emphasis></para> 697 </entry> 698 <entry>(1L<<3)</entry> 699 <entry>Keyboard control change</entry> 700 </row> 701 <row rowsep='0'> 702 <entry> 703<emphasis>XkbIndicatorStateNotifyMask</emphasis> 704 </entry> 705 <entry>(1L<<4)</entry> 706 <entry>Keyboard indicator state change</entry> 707 </row> 708 <row rowsep='0'> 709 <entry> 710<emphasis>XkbIndicatorMapNotifyMask</emphasis> 711 </entry> 712 <entry>(1L<<5)</entry> 713 <entry>Keyboard indicator map change</entry> 714 </row> 715 <row rowsep='0'> 716 <entry> 717<emphasis>XkbNamesNotifyMask</emphasis> 718 </entry> 719 <entry>(1L<<6)</entry> 720 <entry>Keyboard name change</entry> 721 </row> 722 <row rowsep='0'> 723 <entry> 724<emphasis>XkbCompatMapNotifyMask</emphasis> 725 </entry> 726 <entry>(1L<<7)</entry> 727 <entry>Keyboard compat map change</entry> 728 </row> 729 <row rowsep='0'> 730 <entry> 731<emphasis>XkbBellNotifyMask</emphasis> 732 </entry> 733 <entry>(1L<<8)</entry> 734 <entry>Bell</entry> 735 </row> 736 <row rowsep='0'> 737 <entry> 738<emphasis>XkbActionMessageMask</emphasis> 739 </entry> 740 <entry>(1L<<9)</entry> 741 <entry>Action message</entry> 742 </row> 743 <row rowsep='0'> 744 <entry> 745<emphasis>XkbAccessXNotifyMask</emphasis> 746 </entry> 747 <entry>(1L<<10)</entry> 748 <entry>AccessX features</entry> 749 </row> 750 <row rowsep='0'> 751 <entry> 752<emphasis>XkbExtensionDeviceNotifyMask</emphasis> 753 </entry> 754 <entry>(1L<<11)</entry> 755 <entry>Extension device</entry> 756 </row> 757 <row rowsep='0'> 758 <entry> 759<emphasis>XkbAllEventsMask</emphasis> 760 </entry> 761 <entry>(0xFFF)</entry> 762 <entry>All Xkb events</entry> 763 </row> 764</tbody> 765</tgroup> 766</table> 767 768</sect2> 769</sect1> 770<sect1 id='unified_xkb_event_type'> 771<title>Unified Xkb Event Type</title> 772 773<para> 774The <emphasis> 775XkbEvent</emphasis> 776 structure is a union of the individual structures declared for each Xkb event 777type and for the core protocol <emphasis> 778XEvent</emphasis> 779 type. Given an <emphasis> 780XkbEvent</emphasis> 781 structure, you may use the <emphasis> 782type</emphasis> 783 field to determine if the event is an Xkb event (<emphasis> 784type</emphasis> 785 equals the Xkb base event code; see section 2.4). If the event is an Xkb 786event, you may then use the <emphasis> 787any.xkb_type</emphasis> 788 field to determine the type of Xkb event and thereafter access the 789event-dependent components using the union member corresponding to the 790particular Xkb event type. 791</para> 792 793<para><programlisting> 794typedef union _XkbEvent { 795 int type; 796 XkbAnyEvent any; 797 XkbStateNotifyEvent state; 798 XkbMapNotifyEvent map; 799 XkbControlsNotifyEvent ctrls; 800 XkbIndicatorNotifyEvent indicators; 801 XkbBellNotifyEvent bell; 802 XkbAccessXNotifyEvent accessx; 803 XkbNamesNotifyEvent names; 804 XkbCompatMapNotifyEvent compat; 805 XkbActionMessageEvent message; 806 XkbExtensionDeviceNotifyEvent device; 807 XkbNewKeyboardNotifyEvent new_kbd; 808 XEvent core; 809} <emphasis>XkbEvent</emphasis>; 810</programlisting></para> 811 812<para> 813This unified Xkb event type includes a normal <emphasis> 814XEvent</emphasis> 815 as used by the core protocol, so it is straightforward for applications that 816use Xkb events to call the X library event functions without having to cast 817every reference. For example, to get the next event, you can simply declare a 818variable of type <emphasis> 819XkbEvent</emphasis> 820 and call: 821</para> 822 823<para>XNextEvent(dpy,&xkbev.core);</para> 824</sect1> 825</chapter> 826