ch10.xml revision eb411b4b
1<chapter id='Keyboard_Controls'> 2<title>Keyboard Controls</title> 3 4<para> 5The Xkb extension is composed of two parts: a server extension, and a 6client-side X library extension. This chapter discusses functions used to 7modify controls effecting the behavior of the server portion of the Xkb 8extension. Chapter 11 discusses functions used to modify controls that affect 9only the behavior of the client portion of the extension; those controls are 10known as Library Controls. 11</para> 12 13 14<para> 15Xkb contains control features that affect the entire keyboard, known as global 16keyboard controls. Some of the controls may be selectively enabled and 17disabled; these controls are known as the <emphasis> 18Boolean Controls</emphasis> 19. Boolean Controls can be turned on or off under program control and can also 20be automatically set to an on or off condition when a client program exits. The 21remaining controls, known as the <emphasis> 22Non-Boolean Controls</emphasis> 23, are always active. The<emphasis> 24 XkbControlsRec</emphasis> 25 structure describes the current state of most of the global controls and the 26attributes effecting the behavior of each of these Xkb features. This chapter 27describes the Xkb controls and how to manipulate them. 28</para> 29 30 31<para> 32There are two possible components for each of the Boolean Controls: attributes 33describing how the control should work, and a state describing whether the 34behavior as a whole is enabled or disabled. The attributes and state for most 35of these controls are held in the <emphasis> 36XkbControlsRec</emphasis> 37 structure (see section 10.8). 38</para> 39 40 41<para> 42You can manipulate the Xkb controls individually, via convenience functions, or 43as a whole. To treat them as a group, modify an <emphasis> 44XkbControlsRec</emphasis> 45 structure to describe all of the changes to be made, and then pass that 46structure and appropriate flags to an Xkb library function, or use a <emphasis> 47XkbControlsChangesRec</emphasis> 48 (see section 10.10.1) to reduce network traffic. When using a convenience 49function to manipulate one control individually, you do not use an <emphasis> 50XkbControlsRec</emphasis> 51 structure directly. 52</para> 53 54 55<para> 56The Xkb controls are grouped as shown in Table 10.1. <!-- xref --> 57</para> 58 59<table frame='topbot'> 60<title>Xkb Keyboard Controls</title> 61<?dbfo keep-together="always" ?> 62<tgroup cols='3' align='left' colsep='0' rowsep='0'> 63<colspec colname='c1' colwidth='1.5*'/> 64<colspec colname='c2' colwidth='1.5*'/> 65<colspec colname='c3' colwidth='1.0*'/> 66<thead> 67<row rowsep='1'> 68 <entry>Type of Control</entry> 69 <entry>Control Name</entry> 70 <entry>Boolean Control?</entry> 71 </row> 72</thead> 73<tbody> 74 <row> 75 <entry>Controls for enabling and disabling other controls</entry> 76 <entry>EnabledControls</entry> 77 <entry>No</entry> 78 </row> 79 <row> 80 <entry></entry> 81 <entry>AutoReset</entry> 82 <entry>No</entry> 83 </row> 84 <row> 85 <entry>Control for bell behavior</entry> 86 <entry>AudibleBell</entry> 87 <entry>Boolean</entry> 88 </row> 89 <row> 90 <entry>Controls for repeat key behavior</entry> 91 <entry>PerKeyRepeat</entry> 92 <entry>No</entry> 93 </row> 94 <row> 95 <entry></entry> 96 <entry>RepeatKeys</entry> 97 <entry>Boolean</entry> 98 </row> 99 <row> 100 <entry></entry> 101 <entry>DetectableAutorepeat</entry> 102 <entry>Boolean</entry> 103 </row> 104 <row> 105 <entry>Controls for keyboard overlays</entry> 106 <entry>Overlay1</entry> 107 <entry>Boolean</entry> 108 </row> 109 <row> 110 <entry></entry> 111 <entry>Overlay2</entry> 112 <entry>Boolean</entry> 113 </row> 114 <row> 115 <entry>Controls for using the mouse from the keyboard</entry> 116 <entry>MouseKeys</entry> 117 <entry>Boolean</entry> 118 </row> 119 <row> 120 <entry></entry> 121 <entry>MouseKeysAccel</entry> 122 <entry>Boolean</entry> 123 </row> 124 <row> 125 <entry>Controls for better keyboard access by </entry> 126 <entry>AccessXFeedback</entry> 127 <entry>Boolean</entry> 128 </row> 129 <row> 130 <entry>physically impaired persons</entry> 131 <entry>AccessXKeys</entry> 132 <entry>Boolean</entry> 133 </row> 134 <row> 135 <entry></entry> 136 <entry>AccessXTimeout</entry> 137 <entry>Boolean</entry> 138 </row> 139 <row> 140 <entry></entry> 141 <entry>BounceKeys</entry> 142 <entry>Boolean</entry> 143 </row> 144 <row> 145 <entry></entry> 146 <entry>SlowKeys</entry> 147 <entry>Boolean</entry> 148 </row> 149 <row> 150 <entry></entry> 151 <entry>StickyKeys</entry> 152 <entry>Boolean</entry> 153 </row> 154 <row> 155 <entry>Controls for general keyboard mapping</entry> 156 <entry>GroupsWrap</entry> 157 <entry>No</entry> 158 </row> 159 <row> 160 <entry></entry> 161 <entry>IgnoreGroupLock</entry> 162 <entry>Boolean</entry> 163 </row> 164 <row> 165 <entry></entry> 166 <entry>IgnoreLockMods</entry> 167 <entry>No</entry> 168 </row> 169 <row> 170 <entry></entry> 171 <entry>InternalMods</entry> 172 <entry>No</entry> 173 </row> 174 <row> 175 <entry>Miscellaneous per-client controls</entry> 176 <entry>GrabsUseXKBState</entry> 177 <entry>Boolean</entry> 178 </row> 179 <row> 180 <entry></entry> 181 <entry>LookupStateWhenGrabbed</entry> 182 <entry>Boolean</entry> 183 </row> 184 <row> 185 <entry></entry> 186 <entry>SendEventUsesXKBState</entry> 187 <entry>Boolean</entry> 188 </row> 189</tbody> 190</tgroup> 191</table> 192 193<para> 194The individual categories and controls are described first, together with 195functions for manipulating them. A description of the <emphasis> 196XkbControlsRec</emphasis> 197 structure and the general functions for dealing with all of the controls at 198once follow at the end of the chapter. 199</para> 200 201<sect1 id='Controls_that_Enable_and_Disable_Other_Controls'> 202<title>Controls that Enable and Disable Other Controls</title> 203 204<para> 205Enable and disable the boolean controls under program control by using the 206<emphasis> 207EnabledControls</emphasis> 208 control; enable and disable them upon program exit by configuring the 209<emphasis> 210AutoReset</emphasis> 211 control. 212</para> 213 214 215<sect2 id='The_EnabledControls_Control'> 216<title>The EnabledControls Control</title> 217 218<para> 219The <emphasis> 220EnabledControls</emphasis> 221 control is a bit mask where each bit that is turned on means the corresponding 222control is enabled, and when turned off, disabled. It corresponds to the 223<emphasis> 224enabled_ctrls</emphasis> 225 field of an <emphasis> 226XkbControlsRec</emphasis> 227 structure (see section 10.8). The bits describing which controls are turned on 228or off are defined in Table 10.7. <!-- xref --> 229</para> 230 231 232<para> 233Use <emphasis> 234XkbChangeEnabledControls</emphasis> 235 to manipulate the <emphasis> 236EnabledControls</emphasis> 237 control. 238</para> 239 240<informaltable frame='none'> 241<?dbfo keep-together="always" ?> 242<tgroup cols='1' align='left' colsep='0' rowsep='0'> 243<colspec colname='c1' colwidth='1.0*'/> 244<tbody> 245 <row> 246 <entry role='functiondecl'> 247Bool <emphasis> 248XkbChangeEnabledControls</emphasis> 249(<emphasis> 250dpy</emphasis> 251, <emphasis> 252device_spec</emphasis> 253, <emphasis> 254mask</emphasis> 255,<emphasis> 256 values</emphasis> 257) 258 </entry> 259 </row> 260 <row> 261 <entry role='functionargdecl'> 262Display *<emphasis> 263 dpy</emphasis> 264; /* connection to X server */ 265 </entry> 266 </row> 267 <row> 268 <entry role='functionargdecl'> 269unsigned int <emphasis> 270device_spec</emphasis> 271; /* keyboard device to modify */ 272 </entry> 273 </row> 274 <row> 275 <entry role='functionargdecl'> 276unsigned int <emphasis> 277mask</emphasis> 278; /* 1 bit -> controls to enable / disable */ 279 </entry> 280 </row> 281 <row> 282 <entry role='functionargdecl'> 283unsigned int <emphasis> 284values</emphasis> 285; /* 1 bit => enable, 0 bit => disable */ 286 </entry> 287</row> 288</tbody> 289</tgroup> 290</informaltable> 291 292<para> 293The <emphasis> 294mask</emphasis> 295 parameter specifies the boolean controls to be enabled or disabled, and the 296<emphasis> 297values</emphasis> 298 mask specifies the new state for those controls. Valid values for both of 299these masks are composed of a bitwise inclusive OR of bits taken from the set 300of mask bits in Table 10.7, using only those masks with "ok" in the <emphasis> 301enabled_ctrls</emphasis> 302 column. 303</para> 304 305 306<para> 307If the X server does not support a compatible version of Xkb or the Xkb 308extension has not been properly initialized, <emphasis> 309XkbChangeEnabledControls</emphasis> 310 returns <emphasis> 311False</emphasis> 312; otherwise, it sends the request to the X server and returns <emphasis> 313True</emphasis> 314. 315</para> 316 317 318<para> 319Note that the <emphasis> 320EnabledControls</emphasis> 321 control only enables and disables controls; it does not configure them. Some 322controls, such as the <emphasis> 323AudibleBell</emphasis> 324 control, have no configuration attributes and are therefore manipulated solely 325by enabling and disabling them. Others, however, have additional attributes to 326configure their behavior. For example, the <emphasis> 327RepeatControl</emphasis> 328 control uses <emphasis> 329repeat_delay</emphasis> 330 and <emphasis> 331repeat_interval</emphasis> 332 fields to describe the timing behavior of keys that repeat. The <emphasis> 333RepeatControl</emphasis> 334 behavior is turned on or off depending on the value of the <emphasis> 335XkbRepeatKeysMask</emphasis> 336 bit, but you must use other means, as described in this chapter, to configure 337its behavior in detail. 338</para> 339 340 341</sect2> 342<sect2 id='The_AutoReset_Control'> 343<title>The AutoReset Control</title> 344 345<para> 346You can configure the boolean controls to automatically be enabled or disabled 347when a program exits. This capability is controlled via two masks maintained in 348the X server on a per-client basis. There is no client-side Xkb data structure 349corresponding to these masks. Whenever the client exits for any reason, any 350boolean controls specified in the <emphasis> 351auto-reset mask</emphasis> 352 are set to the corresponding value from the <emphasis> 353auto-reset values</emphasis> 354 mask. This makes it possible for clients to "clean up after themselves" 355automatically, even if abnormally terminated. The bits used in the masks 356correspond to the <emphasis> 357EnabledControls</emphasis> 358 control bits. 359</para> 360 361 362<para> 363For example, a client that replaces the keyboard bell with some other audible 364cue might want to turn off the <emphasis> 365AudibleBell</emphasis> 366 control to prevent the server from also generating a sound and avoid 367cacophony. If the client were to exit without resetting the <emphasis> 368AudibleBell </emphasis> 369control, the user would be left without any feedback at all. Setting <emphasis> 370AudibleBell</emphasis> 371 in both the auto-reset mask and auto-reset values guarantees that the audible 372bell will be turned back on when the client exits. 373</para> 374 375 376<para> 377To get the current values of the auto-reset controls, use <emphasis> 378XkbGetAutoResetControls</emphasis> 379. 380</para> 381 382<informaltable frame='none'> 383<?dbfo keep-together="always" ?> 384<tgroup cols='1' align='left' colsep='0' rowsep='0'> 385<colspec colname='c1' colwidth='1.0*'/> 386<tbody> 387 <row> 388 <entry role='functiondecl'> 389Bool <emphasis> 390XkbGetAutoResetControls</emphasis> 391(<emphasis> 392dpy</emphasis> 393, <emphasis> 394auto_ctrls</emphasis> 395, <emphasis> 396auto_values</emphasis> 397) 398 </entry> 399 </row> 400 <row> 401 <entry role='functionargdecl'> 402Display * <emphasis> 403dpy</emphasis> 404; /* connection to X server */ 405 </entry> 406 </row> 407 <row> 408 <entry role='functionargdecl'> 409unsigned int * <emphasis> 410auto_ctrls</emphasis> 411; /* specifies which bits in <emphasis> 412auto_values</emphasis> 413 are relevant */ 414 </entry> 415 </row> 416 <row> 417 <entry role='functionargdecl'> 418unsigned int * <emphasis> 419auto_values</emphasis> 420; /* 1 bit => corresponding control has auto-reset on */ 421 </entry> 422</row> 423</tbody> 424</tgroup> 425</informaltable> 426 427<para> 428<emphasis> 429XkbGetAutoResetControls</emphasis> 430 backfills <emphasis> 431auto_ctrls</emphasis> 432 and <emphasis> 433auto_values</emphasis> 434 with the <emphasis> 435AutoReset</emphasis> 436 control attributes for this particular client. It returns <emphasis> 437True</emphasis> 438 if successful, and <emphasis> 439False</emphasis> 440 otherwise. 441</para> 442 443 444<para> 445To change the current values of the <emphasis> 446AutoReset</emphasis> 447 control attributes, use <emphasis> 448XkbSetAutoResetControls.</emphasis> 449</para> 450 451 452<informaltable frame='none'> 453<?dbfo keep-together="always" ?> 454<tgroup cols='1' align='left' colsep='0' rowsep='0'> 455<colspec colname='c1' colwidth='1.0*'/> 456<tbody> 457 <row> 458 <entry role='functiondecl'> 459Bool <emphasis> 460XkbSetAutoResetControls</emphasis> 461(<emphasis> 462dpy</emphasis> 463, <emphasis> 464changes</emphasis> 465,<emphasis> 466 auto_ctrls</emphasis> 467, <emphasis> 468auto_values</emphasis> 469) 470 </entry> 471 </row> 472 <row> 473 <entry role='functionargdecl'> 474Display * <emphasis> 475dpy</emphasis> 476; /* connection to X server */ 477 </entry> 478 </row> 479 <row> 480 <entry role='functionargdecl'> 481unsigned int <emphasis> 482changes</emphasis> 483; /* controls for which to change auto-reset values */ 484 </entry> 485 </row> 486 <row> 487 <entry role='functionargdecl'> 488unsigned int * <emphasis> 489auto_ctrls</emphasis> 490; /* controls from changes that should auto reset */ 491 </entry> 492 </row> 493 <row> 494 <entry role='functionargdecl'> 495unsigned int * <emphasis> 496auto_values</emphasis> 497; /* 1 bit => auto-reset on */ 498 </entry> 499</row> 500</tbody> 501</tgroup> 502</informaltable> 503 504<para> 505<emphasis> 506XkbSetAutoResetControls changes the auto-reset status and associated auto-reset 507values for the controls selected by </emphasis> 508<emphasis> 509changes</emphasis> 510<emphasis> 511. For any control selected by </emphasis> 512<emphasis> 513changes</emphasis> 514<emphasis> 515, if the corresponding bit is set in </emphasis> 516<emphasis> 517auto_ctrls</emphasis> 518<emphasis> 519, the control is configured to auto-reset when the client exits. If the 520corresponding bit in </emphasis> 521<emphasis> 522auto_values</emphasis> 523<emphasis> 524 is on, the control is turned on when the client exits; if zero, the control is 525turned off when the client exits.</emphasis> 526 For any control selected by <emphasis> 527changes</emphasis> 528, if the corresponding bit is not set in <emphasis> 529auto_ctrls</emphasis> 530, the control is configured to not reset when the client exits. For example: 531</para> 532 533 534<para> 535<emphasis> 536To leave the auto-reset controls for </emphasis> 537<emphasis> 538StickyKeys</emphasis> 539<emphasis> 540 the way they are:</emphasis> 541</para> 542 543<para><programlisting> 544ok = XkbSetAutoResetControls(dpy, 0, 0, 0); 545</programlisting></para> 546 547<para> 548<emphasis> 549To change the auto-reset controls so that </emphasis> 550<emphasis> 551StickyKeys</emphasis> 552<emphasis> 553 are unaffected when the client exits:</emphasis> 554</para> 555 556<para><programlisting> 557ok = XkbSetAutoResetControls(dpy, XkbStickyKeysMask, 0, 0); 558</programlisting></para> 559 560<para> 561<emphasis> 562To change the auto-reset controls so that </emphasis> 563<emphasis> 564StickyKeys</emphasis> 565<emphasis> 566 are turned off when the client exits:</emphasis> 567</para> 568 569<para><programlisting> 570ok = XkbSetAutoResetControls(dpy, XkbStickyKeysMask, XkbStickyKeysMask, 0); 571</programlisting></para> 572 573<para> 574<emphasis> 575To change the auto-reset controls so that </emphasis> 576<emphasis> 577StickyKeys</emphasis> 578<emphasis> 579 are turned on when the client exits:</emphasis> 580</para> 581 582<para><programlisting> 583ok = XkbSetAutoResetControls(dpy, XkbStickyKeysMask, XkbStickyKeysMask, 584XkbStickyKeysMask); 585</programlisting></para> 586 587<para> 588<emphasis> 589XkbSetAutoResetControls</emphasis> 590 backfills <emphasis> 591auto_ctrls</emphasis> 592 and <emphasis> 593auto_values</emphasis> 594 with the auto-reset controls for this particular client. Note that all of the 595bits are valid in the returned values, not just the ones selected in the 596<emphasis> 597changes</emphasis> 598 mask. 599</para> 600 601 602</sect2> 603</sect1> 604<sect1 id='Control_for_Bell_Behavior'> 605<title>Control for Bell Behavior</title> 606 607<para> 608The X server’s generation of sounds is controlled by the <emphasis> 609AudibleBell</emphasis> 610 control. Configuration of different bell sounds is discussed in Chapter 9. 611</para> 612 613 614<sect2 id='The_AudibleBell_Control'> 615<title>The AudibleBell Control</title> 616 617<para> 618The <emphasis> 619AudibleBell</emphasis> 620 control is a boolean control that has no attributes. As such, you may enable 621and disable it using either the <emphasis> 622EnabledControls</emphasis> 623 control or the <emphasis> 624AutoReset</emphasis> 625 control discussed in section 10.1.1. When enabled, protocol requests to <!-- xref --> 626generate a sound result in the X server actually producing a real sound; when 627disabled, requests to the server to generate a sound are ignored unless the 628sound is forced. See section 9.2. <!-- xref --> 629</para> 630 631 632</sect2> 633</sect1> 634<sect1 id='Controls_for_Repeat_Key_Behavior'> 635<title>Controls for Repeat Key Behavior</title> 636 637<para> 638The repeating behavior of keyboard keys is governed by three controls, the 639<emphasis> 640PerKeyRepeat</emphasis> 641 control, which is always active, and the <emphasis> 642RepeatKeys</emphasis> 643 and <emphasis> 644DetectableAutorepeat</emphasis> 645 controls, which are boolean controls that may be enabled and disabled. 646<emphasis> 647PerKeyRepeat</emphasis> 648 determines which keys are allowed to repeat. <emphasis> 649RepeatKeys</emphasis> 650 governs the behavior of an individual key when it is repeating. <emphasis> 651DetectableAutorepeat</emphasis> 652 allows a client to detect when a key is repeating as a result of being held 653down. 654</para> 655 656 657<sect2 id='The_PerKeyRepeat_Control'> 658<title>The PerKeyRepeat Control</title> 659 660<para> 661The <emphasis> 662PerKeyRepeat</emphasis> 663 control is a bitmask long enough to contain a bit for each key on the device; 664it determines which individual keys are allowed to repeat. The Xkb <emphasis> 665PerKeyRepeat</emphasis> 666 control provides no functionality different from that available via the core X 667protocol. There are no convenience functions in Xkb for manipulating this 668control. The <emphasis> 669PerKeyRepeat</emphasis> 670 control settings are carried in the <emphasis> 671per_key_repeat</emphasis> 672 field of an <emphasis> 673XkbControlsRec</emphasis> 674 structure, discussed in section 10.8. <!-- xref --> 675</para> 676 677 678</sect2> 679<sect2 id='The_RepeatKeys_Control'> 680<title>The RepeatKeys Control</title> 681 682<para> 683The core protocol allows only control over whether or not the entire keyboard 684or individual keys should auto-repeat when held down. <emphasis> 685RepeatKeys</emphasis> 686 is a boolean control that extends this capability by adding control over the 687delay until a key begins to repeat and the rate at which it repeats. <emphasis> 688RepeatKeys</emphasis> 689 is coupled with the core auto-repeat control: when <emphasis> 690RepeatKeys</emphasis> 691 is enabled or disabled, the core auto-repeat is enabled or disabled and vice 692versa. 693</para> 694 695 696<para> 697Auto-repeating keys are controlled by two attributes. The first, <emphasis> 698timeout</emphasis> 699, is the delay after the initial press of an auto-repeating key and the first 700generated repeat event. The second, <emphasis> 701interval</emphasis> 702, is the delay between all subsequent generated repeat events. As with all 703boolean controls, configuring the attributes that determine how the control 704operates does not automatically enable the control as a whole; see section 10.1. 705</para> 706 707 708<para> 709To get the current attributes of the <emphasis> 710RepeatKeys</emphasis> 711 control for a keyboard device, use <emphasis> 712XkbGetAutoRepeatRate</emphasis> 713. 714</para> 715 716<informaltable frame='none'> 717<?dbfo keep-together="always" ?> 718<tgroup cols='1' align='left' colsep='0' rowsep='0'> 719<colspec colname='c1' colwidth='1.0*'/> 720<tbody> 721 <row> 722 <entry role='functiondecl'> 723Bool <emphasis> 724XkbGetAutoRepeatRate</emphasis> 725(<emphasis> 726display, device_spec, timeout_rtrn, interval_rtrn</emphasis> 727) 728 </entry> 729 </row> 730 <row> 731 <entry role='functionargdecl'> 732Display *<emphasis> 733 display</emphasis> 734; /* connection to X server */ 735 </entry> 736 </row> 737 <row> 738 <entry role='functionargdecl'> 739unsigned int <emphasis> 740 device_spec</emphasis> 741; /* desired device ID, or <emphasis> 742XkbUseCoreKbd</emphasis> 743 */ 744 </entry> 745 </row> 746 <row> 747 <entry role='functionargdecl'> 748unsigned int <emphasis> 749* timeout_rtrn</emphasis> 750; /* backfilled with initial repeat delay, ms */ 751 </entry> 752 </row> 753 <row> 754 <entry role='functionargdecl'> 755unsigned int <emphasis> 756* interval_rtrn</emphasis> 757; /* backfilled with subsequent repeat delay, ms */ 758 </entry> 759</row> 760</tbody> 761</tgroup> 762</informaltable> 763 764<para> 765<emphasis> 766XkbGetAutoRepeatRate</emphasis> 767 queries the server for the current values of the <emphasis> 768RepeatControls</emphasis> 769 control attributes, backfills <emphasis> 770timeout_rtrn</emphasis> 771 and <emphasis> 772interval_rtrn</emphasis> 773 with them, and returns <emphasis> 774True</emphasis> 775. If a compatible version of the Xkb extension is not available in the server 776<emphasis> 777XkbGetAutoRepeatRate</emphasis> 778 returns <emphasis> 779False</emphasis> 780. 781</para> 782 783 784<para> 785To set the attributes of the RepeatKeys control for a keyboard device, use 786<emphasis> 787XkbSetAutoRepeatRate</emphasis> 788. 789</para> 790 791 792<informaltable frame='none'> 793<?dbfo keep-together="always" ?> 794<tgroup cols='1' align='left' colsep='0' rowsep='0'> 795<colspec colname='c1' colwidth='1.0*'/> 796<tbody> 797 <row> 798 <entry role='functiondecl'> 799Bool <emphasis> 800XkbSetAutoRepeatRate</emphasis> 801(<emphasis> 802display, device_spec, timeout, interval</emphasis> 803) 804 </entry> 805 </row> 806 <row> 807 <entry role='functionargdecl'> 808Display *<emphasis> 809 display</emphasis> 810; /* connection to X server */ 811 </entry> 812 </row> 813 <row> 814 <entry role='functionargdecl'> 815unsigned int <emphasis> 816device_spec</emphasis> 817; /* device to configure, or <emphasis> 818XkbUseCoreKbd</emphasis> 819 */ 820 </entry> 821 </row> 822 <row> 823 <entry role='functionargdecl'> 824unsigned int<emphasis> 825 timeout</emphasis> 826; /* initial delay, ms */ 827 </entry> 828 </row> 829 <row> 830 <entry role='functionargdecl'> 831unsigned int <emphasis> 832 interval</emphasis> 833; /* delay between repeats, ms */ 834 </entry> 835</row> 836</tbody> 837</tgroup> 838</informaltable> 839 840<para> 841<emphasis> 842XkbSetAutoRepeatRate</emphasis> 843 sends a request to the X server to configure the <emphasis> 844AutoRepeat</emphasis> 845 control attributes to the values specified in <emphasis> 846timeout</emphasis> 847 and <emphasis> 848interval</emphasis> 849. 850</para> 851 852 853<para> 854<emphasis> 855XkbSetAutoRepeatRate</emphasis> 856 does not wait for a reply; it normally returns <emphasis> 857True</emphasis> 858. Specifying a zero value for either <emphasis> 859timeout</emphasis> 860 or <emphasis> 861interval</emphasis> 862 causes the server to generate a <emphasis> 863BadValue</emphasis> 864 protocol error. If a compatible version of the Xkb extension is not available 865in the server, <emphasis> 866XkbSetAutoRepeatRate</emphasis> 867 returns <emphasis> 868False</emphasis> 869. 870</para> 871 872 873</sect2> 874<sect2 id='The_DetectableAutorepeat_Control'> 875<title>The DetectableAutorepeat Control</title> 876 877<para> 878Auto-repeat is the generation of multiple key events by a keyboard when the 879user presses a key and holds it down. Keyboard hardware and device-dependent X 880server software often implement auto-repeat by generating multiple <emphasis> 881KeyPress</emphasis> 882 events with no intervening <emphasis> 883KeyRelease</emphasis> 884 event. The standard behavior of the X server is to generate a <emphasis> 885KeyRelease</emphasis> 886 event for every <emphasis> 887KeyPress</emphasis> 888 event. If the keyboard hardware and device-dependent software of the X server 889implement auto-repeat by generating multiple <emphasis> 890KeyPress</emphasis> 891 events, the device-independent part of the X server by default synthetically 892generates a <emphasis> 893KeyRelease</emphasis> 894 event after each <emphasis> 895KeyPress</emphasis> 896 event. This provides predictable behavior for X clients, but does not allow 897those clients to detect the fact that a key is auto-repeating. 898</para> 899 900 901<para> 902Xkb allows clients to request <emphasis> 903detectable auto-repeat</emphasis> 904. If a client requests and the server supports <emphasis> 905DetectableAutorepeat</emphasis> 906, Xkb generates <emphasis> 907KeyRelease</emphasis> 908 events only when the key is physically released. If <emphasis> 909DetectableAutorepeat</emphasis> 910 is not supported or has not been requested, the server synthesizes a <emphasis> 911KeyRelease</emphasis> 912 event for each repeating <emphasis> 913KeyPress</emphasis> 914 event it generates. 915</para> 916 917 918<para> 919<emphasis> 920DetectableAutorepeat</emphasis> 921, unlike the other controls in this chapter, is not contained in the <emphasis> 922XkbControlsRec</emphasis> 923 structure, nor can it be enabled or disabled via the <emphasis> 924EnabledControls</emphasis> 925 control. Instead, query and set <emphasis> 926DetectableAutorepeat</emphasis> 927 using <emphasis> 928XkbGetDetectableAutorepeat</emphasis> 929 and <emphasis> 930XkbSetDetectableAutorepeat</emphasis> 931. 932</para> 933 934 935<para> 936<emphasis> 937DetectableAutorepeat</emphasis> 938 is a condition that applies to all keyboard devices for a client’s 939connection to a given X server; it cannot be selectively set for some devices 940and not for others. For this reason, none of the Xkb library functions 941involving <emphasis> 942DetectableAutorepeat</emphasis> 943 involve a device specifier. 944</para> 945 946 947<para> 948To determine whether or not the server supports <emphasis> 949DetectableAutorepeat</emphasis> 950, use <emphasis> 951XkbGetDetectableAutorepeat</emphasis> 952. 953</para> 954 955<informaltable frame='none'> 956<?dbfo keep-together="always" ?> 957<tgroup cols='1' align='left' colsep='0' rowsep='0'> 958<colspec colname='c1' colwidth='1.0*'/> 959<tbody> 960 <row> 961 <entry role='functiondecl'> 962Bool <emphasis> 963XkbGetDetectableAutorepeat</emphasis> 964(<emphasis> 965display, supported_rtrn</emphasis> 966) 967 </entry> 968 </row> 969 <row> 970 <entry role='functionargdecl'> 971Display *<emphasis> 972 display</emphasis> 973; /* connection to X server */ 974 </entry> 975 </row> 976 <row> 977 <entry role='functionargdecl'> 978Bool *<emphasis> 979 supported_rtrn</emphasis> 980; /* backfilled <emphasis> 981True</emphasis> 982 if <emphasis> 983DetectableAutorepeat</emphasis> 984 supported */ 985 </entry> 986</row> 987</tbody> 988</tgroup> 989</informaltable> 990 991<para> 992<emphasis> 993XkbGetDetectableAutorepeat</emphasis> 994 queries the server for the current state of <emphasis> 995DetectableAutorepeat</emphasis> 996 and waits for a reply. If <emphasis> 997supported_rtrn</emphasis> 998 is not <emphasis> 999NULL</emphasis> 1000, it backfills supported_rtrn with <emphasis> 1001True</emphasis> 1002 if the server supports <emphasis> 1003DetectableAutorepeat</emphasis> 1004, and <emphasis> 1005False</emphasis> 1006 otherwise. <emphasis> 1007XkbGetDetectableAutorepeat</emphasis> 1008 returns the current state of <emphasis> 1009DetectableAutorepeat</emphasis> 1010 for the requesting client: <emphasis> 1011True</emphasis> 1012 if <emphasis> 1013DetectableAutorepeat</emphasis> 1014 is set, and <emphasis> 1015False</emphasis> 1016 otherwise. 1017</para> 1018 1019 1020<para> 1021To set <emphasis> 1022DetectableAutorepeat</emphasis> 1023, use <emphasis> 1024XkbSetDetectableAutorepeat</emphasis> 1025. This request affects all keyboard activity for the requesting client only; 1026other clients still see the expected nondetectable auto-repeat behavior, unless 1027they have requested otherwise. 1028</para> 1029 1030 1031<informaltable frame='none'> 1032<?dbfo keep-together="always" ?> 1033<tgroup cols='1' align='left' colsep='0' rowsep='0'> 1034<colspec colname='c1' colwidth='1.0*'/> 1035<tbody> 1036 <row> 1037 <entry role='functiondecl'> 1038Bool <emphasis> 1039XkbSetDetectableAutorepeat</emphasis> 1040(<emphasis> 1041display, detectable, supported_rtrn</emphasis> 1042) 1043 </entry> 1044 </row> 1045 <row> 1046 <entry role='functionargdecl'> 1047Display *<emphasis> 1048 display</emphasis> 1049; /* connection to X server */ 1050 </entry> 1051 </row> 1052 <row> 1053 <entry role='functionargdecl'> 1054Bool<emphasis> 1055 detectable</emphasis> 1056; /* <emphasis> 1057True</emphasis> 1058 => set <emphasis> 1059DetectableAutorepeat</emphasis> 1060 */ 1061 </entry> 1062 </row> 1063 <row> 1064 <entry role='functionargdecl'> 1065Bool *<emphasis> 1066 supported_rtrn</emphasis> 1067; /* backfilled <emphasis> 1068True</emphasis> 1069 if <emphasis> 1070DetectableAutorepeat</emphasis> 1071 supported */ 1072 </entry> 1073</row> 1074</tbody> 1075</tgroup> 1076</informaltable> 1077 1078<para> 1079<emphasis> 1080XkbSetDetectableAutorepeat</emphasis> 1081 sends a request to the server to set <emphasis> 1082DetectableAutorepeat</emphasis> 1083 on for the current client if <emphasis> 1084detectable</emphasis> 1085 is <emphasis> 1086True</emphasis> 1087, and off it <emphasis> 1088detectable</emphasis> 1089 is <emphasis> 1090False</emphasis> 1091; it then waits for a reply. If <emphasis> 1092supported_rtrn</emphasis> 1093 is not <emphasis> 1094NULL</emphasis> 1095, <emphasis> 1096XkbSetDetectableAutorepeat</emphasis> 1097 backfills <emphasis> 1098supported_rtrn</emphasis> 1099 with <emphasis> 1100True</emphasis> 1101 if the server supports <emphasis> 1102DetectableAutorepeat</emphasis> 1103, and <emphasis> 1104False</emphasis> 1105 if it does not. <emphasis> 1106XkbSetDetectableAutorepeat</emphasis> 1107 returns the current state of <emphasis> 1108DetectableAutorepeat</emphasis> 1109 for the requesting client: <emphasis> 1110True</emphasis> 1111 if <emphasis> 1112DetectableAutorepeat</emphasis> 1113 is set, and <emphasis> 1114False</emphasis> 1115 otherwise. 1116</para> 1117 1118 1119</sect2> 1120</sect1> 1121<sect1 id='Controls_for_Keyboard_Overlays_Overlay1_and_Overlay2_Controls'> 1122<title>Controls for Keyboard Overlays (Overlay1 and Overlay2 Controls)</title> 1123 1124<para> 1125A keyboard overlay allows some subset of the keyboard to report alternate 1126keycodes when the overlay is enabled. For example, a keyboard overlay can be 1127used to simulate a numeric or editing keypad on a keyboard that does not 1128actually have one by reusing some portion of the keyboard as an overlay. This 1129technique is very common on portable computers and embedded systems with small 1130keyboards. 1131</para> 1132 1133 1134<para> 1135Xkb includes direct support for two keyboard overlays, using the <emphasis> 1136Overlay1</emphasis> 1137 and <emphasis> 1138Overlay2</emphasis> 1139 controls. When <emphasis> 1140Overlay1</emphasis> 1141 is enabled, all of the keys that are members of the first keyboard overlay 1142generate an alternate keycode. When <emphasis> 1143Overlay2</emphasis> 1144 is enabled, all of the keys that are members of the second keyboard overlay 1145generate an alternate keycode. The two overlays are mutually exclusive; any 1146particular key may be in at most one overlay. <emphasis> 1147Overlay1</emphasis> 1148 and <emphasis> 1149Overlay2</emphasis> 1150 are boolean controls. As such, you may enable and disable them using either 1151the <emphasis> 1152EnabledControls</emphasis> 1153 control or the <emphasis> 1154AutoReset</emphasis> 1155 control discussed in section 10.1.1. <!-- xref --> 1156</para> 1157 1158 1159<para> 1160To specify the overlay to which a key belongs and the alternate keycode it 1161should generate when that overlay is enabled, assign it either the <emphasis> 1162XkbKB_Overlay1</emphasis> 1163 or <emphasis> 1164XkbKB_Overlay2</emphasis> 1165 key behaviors, as described in section 16.2. <!-- xref --> 1166</para> 1167 1168 1169</sect1> 1170<sect1 id='Controls_for_Using_the_Mouse_from_the_Keyboard'> 1171<title>Controls for Using the Mouse from the Keyboard</title> 1172 1173<para> 1174Using Xkb, it is possible to configure the keyboard to allow simulation of the 1175X pointer device. This simulation includes both movement of the pointer itself 1176and press and release events associated with the buttons on the pointer. Two 1177controls affect this behavior: the <emphasis> 1178MouseKeys</emphasis> 1179 control determines whether or not simulation of the pointer device is active, 1180as well as configuring the default button; the <emphasis> 1181MouseKeysAccel</emphasis> 1182 control determines the movement characteristics of the pointer when simulated 1183via the keyboard. Both of them are boolean controls; as such, you may enable 1184and disable them using either the <emphasis> 1185EnabledControls</emphasis> 1186 control or the <emphasis> 1187AutoReset</emphasis> 1188 control discussed in section 10.1.1. The individual keys that simulate <!-- xref --> 1189different aspects of the pointer device are determined by the keyboard mapping, 1190discussed in Chapter 16. <!-- xref --> 1191</para> 1192 1193 1194<sect2 id='The_MouseKeys_Control'> 1195<title>The MouseKeys Control</title> 1196 1197<para> 1198The <emphasis> 1199MouseKeys</emphasis> 1200 control allows a user to control all the mouse functions from the keyboard. 1201When <emphasis> 1202MouseKeys</emphasis> 1203 are enabled, all keys with <emphasis> 1204MouseKeys</emphasis> 1205 actions bound to them generate core pointer events instead of normal <emphasis> 1206KeyPress</emphasis> 1207 and <emphasis> 1208KeyRelease</emphasis> 1209 events. 1210</para> 1211 1212 1213<para> 1214The <emphasis> 1215MouseKeys</emphasis> 1216 control has a single attribute, <emphasis> 1217mk_dflt_btn</emphasis> 1218 that specifies the core button number to be used by mouse keys actions that do 1219not explicitly specify a button. There is no convenience function for getting 1220or setting the attribute; instead use <emphasis> 1221XkbGetControls</emphasis> 1222 and <emphasis> 1223XkbSetControls</emphasis> 1224 (see sections 10.9 and 10.10). <!-- xref --> 1225</para> 1226 1227<note><para><emphasis> 1228MouseKeys</emphasis> 1229 can also be turned on and off by pressing the key combination necessary to 1230produce an <emphasis> 1231XK_Pointer_EnableKeys</emphasis> 1232 keysym. The de facto default standard for this is <emphasis> 1233Shift+Alt+NumLock</emphasis> 1234, but this may vary depending on the keymap.</para></note> 1235 1236</sect2> 1237<sect2 id='The_MouseKeysAccel_Control'> 1238<title>The MouseKeysAccel Control</title> 1239 1240<para> 1241When the <emphasis> 1242MouseKeysAccel</emphasis> 1243 control is enabled, the effect of a key-activated pointer motion action 1244changes as a key is held down. If the control is disabled, pressing a 1245mouse-pointer key yields one mouse event. When <emphasis> 1246MouseKeysAccel</emphasis> 1247 is enabled, mouse movement is defined by an initial distance specified in the 1248<emphasis> 1249XkbSA_MovePtr</emphasis> 1250 action and the following fields in the <emphasis> 1251XkbControlsRec</emphasis> 1252 structure (see section 10.8). <!-- xref --> 1253</para> 1254 1255<table frame='topbot'> 1256<title>MouseKeysAccel Fields</title> 1257<?dbfo keep-together="always" ?> 1258<tgroup cols='2' align='left' colsep='0' rowsep='0'> 1259<colspec colname='c1' colwidth='1.0*'/> 1260<colspec colname='c2' colwidth='2.0*'/> 1261<thead> 1262<row rowsep='1'> 1263 <entry>Field</entry> 1264 <entry>Function</entry> 1265</row> 1266</thead> 1267<tbody> 1268<row> 1269 <entry>mk_delay</entry> 1270 <entry>Time (ms) between the initial key press and the first repeated 1271motion event</entry> 1272</row> 1273<row> 1274 <entry>mk_interval</entry> 1275 <entry>Time (ms) between repeated motion events</entry> 1276</row> 1277<row> 1278 <entry>mk_time_to_max</entry> 1279 <entry>Number of events (count) before the pointer reaches maximum 1280speed</entry> 1281</row> 1282<row> 1283 <entry>mk_max_speed</entry> 1284 <entry>The maximum speed (in pixels per event) the pointer reaches</entry> 1285</row> 1286<row> 1287 <entry>mk_curve</entry> 1288 <entry>The ramp used to reach maximum pointer speed</entry> 1289 </row> 1290</tbody> 1291</tgroup> 1292</table> 1293 1294<para> 1295There are no convenience functions to query or change the attributes of the 1296<emphasis> 1297MouseKeysAccel</emphasis> 1298 control; instead use <emphasis> 1299XkbGetControls</emphasis> 1300 and <emphasis> 1301XkbSetControls</emphasis> 1302 (see sections 10.9 and 10.10). <!-- xref --> 1303</para> 1304 1305 1306<para> 1307The effects of the attributes of the <emphasis> 1308MouseKeysAccel</emphasis> 1309 control depend on whether the <emphasis> 1310XkbSA_MovePtr</emphasis> 1311 action (see section 16.1) specifies relative or absolute pointer motion. <!-- xref --> 1312</para> 1313 1314<sect3 id='Absolute_Pointer_Motion'> 1315<title>Absolute Pointer Motion</title> 1316 1317<para> 1318If an <emphasis> 1319XkbSA_MovePtr</emphasis> 1320 action specifies an absolute position for one of the coordinates but still 1321allows acceleration, all repeated events contain any absolute coordinates 1322specified in the action. For example, if the <emphasis> 1323XkbSA_MovePtr</emphasis> 1324 action specifies an absolute position for the X direction, but a relative 1325motion for the Y direction, the pointer accelerates in the Y direction, but 1326stays at the same X position. 1327</para> 1328 1329 1330</sect3> 1331<sect3 id='Relative_Pointer_Motion'> 1332<title>Relative Pointer Motion</title> 1333 1334<para> 1335If the <emphasis> 1336XkbSA_MovePtr</emphasis> 1337 action specifies relative motion, the initial event always moves the cursor 1338the distance specified in the action. After <emphasis> 1339mk_delay</emphasis> 1340 milliseconds, a second motion event is generated, and another occurs every 1341<emphasis> 1342mk_interval</emphasis> 1343 milliseconds until the user releases the key. 1344</para> 1345 1346 1347<para> 1348Between the time of the second motion event and <emphasis> 1349mk_time_to_max</emphasis> 1350 intervals, the change in pointer distance per interval increases with each 1351interval. After <emphasis> 1352mk_time_to_max</emphasis> 1353 intervals have elapsed, the change in pointer distance per interval remains 1354the same and is calculated by multiplying the original distance specified in 1355the action by <emphasis> 1356mk_max_speed</emphasis> 1357. 1358</para> 1359 1360 1361<para> 1362For example, if the <emphasis> 1363XkbSA_MovePtr</emphasis> 1364 action specifies a relative motion in the X direction of 5, <emphasis> 1365mk_delay</emphasis> 1366=160, <emphasis> 1367mk_interval</emphasis> 1368=40, <emphasis> 1369mk_time_to_max</emphasis> 1370=30, and <emphasis> 1371mk_max_speed</emphasis> 1372=30, the following happens when the user presses the key: 1373</para> 1374 1375<itemizedlist> 1376<listitem> 1377 <para> 1378The pointer immediately moves 5 pixels in the X direction when the key is 1379pressed. 1380 </para> 1381</listitem> 1382<listitem> 1383 <para> 1384After 160 milliseconds (<emphasis> 1385mk_delay</emphasis> 1386), and every 40 milliseconds thereafter (<emphasis> 1387mk_interval</emphasis> 1388), the pointer moves in the X direction. 1389 </para> 1390</listitem> 1391<listitem> 1392 <para> 1393The distance in the X direction increases with each interval until 30 intervals 1394(<emphasis> 1395mk_time_to_max</emphasis> 1396) have elapsed. 1397 </para> 1398</listitem> 1399<listitem> 1400 <para> 1401After 30 intervals, the pointer stops accelerating, and moves 150 pixels 1402(<emphasis> 1403mk_max_speed</emphasis> 1404 * the original distance) every interval thereafter, until the key is released. 1405 </para> 1406</listitem> 1407</itemizedlist> 1408 1409<para> 1410The increase in pointer difference for each interval is a function of<emphasis> 1411 mk_curve.</emphasis> 1412 Events after the first but before maximum acceleration has been achieved are 1413accelerated according to the formula: 1414</para> 1415 1416<mediaobject> 1417 <imageobject> <imagedata format="SVG" fileref="XKBlib-3.svg"/> 1418 </imageobject> 1419 </mediaobject> 1420 1421 1422<para> 1423Where <emphasis> 1424action_delta</emphasis> 1425 is the relative motion specified by the <emphasis> 1426XkbSA_MovePtr</emphasis> 1427 action, <emphasis> 1428mk_max_speed </emphasis> 1429and <emphasis> 1430mk_time_to_max</emphasis> 1431 are parameters to the <emphasis> 1432MouseKeysAccel</emphasis> 1433 control, and the curveFactor is computed using the <emphasis> 1434MouseKeysAccel</emphasis> 1435 <emphasis> 1436mk_curve</emphasis> 1437 parameter as follows: 1438</para> 1439 1440<mediaobject> 1441 <imageobject> <imagedata format="SVG" fileref="XKBlib-4.svg"/> 1442 </imageobject> 1443 </mediaobject> 1444 1445 1446<para> 1447With the result that a <emphasis> 1448mk_curve</emphasis> 1449 of zero causes the distance moved to increase linearly from <emphasis> 1450action_delta</emphasis> 1451 to <mediaobject> 1452 <imageobject> <imagedata format="SVG" fileref="XKBlib-5.svg"/> 1453 </imageobject> 1454 </mediaobject> 1455 1456. A negative <emphasis> 1457mk_curve</emphasis> 1458 causes an initial sharp increase in acceleration that tapers off, and a 1459positive curve yields a slower initial increase in acceleration followed by a 1460sharp increase as the number of pointer events generated by the action 1461approaches <emphasis> 1462mk_time_to_max</emphasis> 1463. The legal values for <emphasis> 1464mk_curve</emphasis> 1465 are between -1000 and 1000. 1466</para> 1467 1468 1469<para> 1470A distance vs. time graph of the pointer motion is shown in Figure 10.1. <!-- xref --> 1471</para> 1472 1473<mediaobject> 1474 <imageobject> <imagedata format="SVG" fileref="XKBlib-6.svg"/> 1475 </imageobject> 1476<caption>MouseKeys Acceleration</caption> 1477 </mediaobject> 1478 1479<!-- 1480<H5 CLASS="Figure"> 1481MouseKeys Acceleration</H5> 1482--> 1483</sect3> 1484</sect2> 1485</sect1> 1486<sect1 id='Controls_for_Better_Keyboard_Access_by_Physically_ImpairedPersons'> 1487<title>Controls for Better Keyboard Access by Physically Impaired 1488Persons</title> 1489 1490<para> 1491The Xkb extension includes several controls specifically aimed at making 1492keyboard use more effective for physically impaired people. All of these 1493controls are boolean controls and may be individually enabled and disabled, as 1494well as configured to tune their specific behavior. The behavior of these 1495controls is based on the AccessDOS package 1496<footnote><para> 1497AccessDOS provides access to the DOS operating system for people with physical 1498impairments and was developed by the Trace R&D Center at the University of 1499Wisconsin. For more information on AccessDOS, contact the Trace R&D Center, 1500Waisman Center and Department of Industrial Engineering, University of 1501Wisconsin-Madison WI 53705-2280. Phone: 608-262-6966. e-mail: info@trace.wisc.edu. 1502</para></footnote>. 1503</para> 1504 1505<sect2 id='The_AccessXKeys_Control'> 1506<title>The AccessXKeys Control</title> 1507 1508<para> 1509Enabling or disabling the keyboard controls through a graphical user interface 1510may be impossible for people who need to use the controls. For example, a user 1511who needs <emphasis> 1512SlowKeys</emphasis> 1513 (see section 10.6.6) may not even be able to start the graphical application, <!-- xref --> 1514let alone use it, if <emphasis> 1515SlowKeys</emphasis> 1516 is not enabled. To allow easier access to some of the controls, the <emphasis> 1517AccessXKeys</emphasis> 1518 control provides a set of special key sequences similar to those available in 1519AccessDOS. 1520</para> 1521 1522 1523<para> 1524When the <emphasis> 1525AccessXKeys</emphasis> 1526 control is enabled, the user can turn controls on or off from the keyboard by 1527entering the following standard key sequences: 1528</para> 1529 1530<itemizedlist> 1531<listitem> 1532 <para> 1533Holding down a shift key by itself for eight seconds toggles the <emphasis> 1534SlowKeys</emphasis> 1535 control. 1536 </para> 1537</listitem> 1538<listitem> 1539 <para> 1540Pressing and releasing the left or right <emphasis> 1541Shift</emphasis> 1542 key five times in a row, without any intervening key events and with less than 154330 seconds delay between consecutive presses, toggles the state of the 1544<emphasis> 1545StickyKeys</emphasis> 1546 control. 1547 </para> 1548</listitem> 1549<listitem> 1550 <para> 1551Simultaneously operating two or more modifier keys deactivates the <emphasis> 1552StickyKeys</emphasis> 1553 control. 1554 </para> 1555</listitem> 1556</itemizedlist> 1557 1558<para> 1559When the <emphasis> 1560AccessXKeys</emphasis> 1561 control is disabled, Xkb does not look for the above special key sequences. 1562</para> 1563 1564 1565<para> 1566Some of these key sequences optionally generate audible feedback of the change 1567in state, as described in section 10.6.3, or <!-- xref --> 1568<emphasis>XkbControlsNotify</emphasis> 1569 events, described in section 10.11. <!-- xref --> 1570</para> 1571 1572</sect2> 1573<sect2 id='The_AccessXTimeout_Control'> 1574<title>The AccessXTimeout Control</title> 1575 1576<para> 1577In environments where computers are shared, features such as <emphasis> 1578SlowKeys</emphasis> 1579 present a problem: if <emphasis> 1580SlowKeys</emphasis> 1581 is on, the keyboard can appear to be unresponsive because keys are not 1582accepted until they are held for a certain period of time. To help solve this 1583problem, Xkb provides an <emphasis> 1584AccessXTimeout</emphasis> 1585 control to automatically change the enabled/disabled state of any boolean 1586controls and to change the value of the <emphasis> 1587AccessXKeys</emphasis> 1588 and <emphasis> 1589AccessXFeedback</emphasis> 1590 control attributes if the keyboard is idle for a specified period of time. 1591</para> 1592 1593 1594<para> 1595When a timeout as specified by <emphasis> 1596AccessXTimeout</emphasis> 1597 occurs and a control is consequently modified, Xkb generates an <emphasis> 1598XkbControlsNotify</emphasis> 1599 event. For more information on <emphasis> 1600XkbControlsNotify</emphasis> 1601 events, refer to section 10.11. <!-- xref --> 1602</para> 1603 1604 1605<para> 1606Use <emphasis> 1607XkbGetAccessXTimeout</emphasis> 1608 to query the current <emphasis> 1609AccessXTimeout</emphasis> 1610 options for a keyboard device. 1611</para> 1612 1613<informaltable frame='none'> 1614<?dbfo keep-together="always" ?> 1615<tgroup cols='1' align='left' colsep='0' rowsep='0'> 1616<colspec colname='c1' colwidth='1.0*'/> 1617<tbody> 1618 <row> 1619 <entry role='functiondecl'> 1620Bool <emphasis> 1621XkbGetAccessXTimeout</emphasis> 1622(<emphasis> 1623display</emphasis> 1624,<emphasis> 1625 device_spec</emphasis> 1626,<emphasis> 1627 timeout_rtrn</emphasis> 1628,<emphasis> 1629 ctrls_mask_rtrn</emphasis> 1630,<emphasis> 1631 ctrls_values_rtrn</emphasis> 1632,<emphasis> 1633 options_mask_rtrn, options_values_rtrn</emphasis> 1634) 1635 </entry> 1636 </row> 1637 <row> 1638 <entry role='functionargdecl'> 1639Display *<emphasis> 1640 display</emphasis> 1641; /* connection to X server */ 1642 </entry> 1643 </row> 1644 <row> 1645 <entry role='functionargdecl'> 1646unsigned int <emphasis> 1647device_spec</emphasis> 1648; /* device to query, or <emphasis> 1649XkbUseCoreKbd</emphasis> 1650 */ 1651 </entry> 1652 </row> 1653 <row> 1654 <entry role='functionargdecl'> 1655unsigned short * <emphasis> 1656timeout_rtrn</emphasis> 1657; /* delay until AccessXTimeout, seconds */ 1658 </entry> 1659 </row> 1660 <row> 1661 <entry role='functionargdecl'> 1662unsigned int *<emphasis> 1663 ctrls_mask_rtrn</emphasis> 1664; /* backfilled with controls to modify */ 1665 </entry> 1666 </row> 1667 <row> 1668 <entry role='functionargdecl'> 1669unsigned int * <emphasis> 1670ctrls_values_rtrn</emphasis> 1671; /* backfilled with on/off status for controls */ 1672 </entry> 1673 </row> 1674 <row> 1675 <entry role='functionargdecl'> 1676unsigned short * <emphasis> 1677opts_mask_rtrn</emphasis> 1678; /* backfilled with <emphasis> 1679ax_options</emphasis> 1680 to modify */ 1681 </entry> 1682 </row> 1683 <row> 1684 <entry role='functionargdecl'> 1685unsigned short * <emphasis> 1686opts_values_rtrn</emphasis> 1687; /* backfilled with values for <emphasis> 1688ax_options</emphasis> 1689 */ 1690 </entry> 1691</row> 1692</tbody> 1693</tgroup> 1694</informaltable> 1695 1696<para> 1697<emphasis> 1698XkbGetAccessXTimeout</emphasis> 1699 sends a request to the X server to obtain the current values for the <emphasis> 1700AccessXTimeout</emphasis> 1701 attributes, waits for a reply, and backfills the values into the appropriate 1702arguments.<emphasis> 1703 </emphasis> 1704The parameters <emphasis> 1705opts_mask_rtrn</emphasis> 1706 and <emphasis> 1707opts_values_rtrn</emphasis> 1708 are backfilled with the options to modify and the values for <emphasis> 1709ax_options</emphasis> 1710, which is a field in the 1711<emphasis>XkbControlsRec</emphasis> 1712 structure (see section 10.8). <!-- xref --> 1713<emphasis> 1714XkbGetAccessXTimeout </emphasis> 1715returns<emphasis> 1716 </emphasis> 1717<emphasis> 1718True</emphasis> 1719 if successful; if a compatible version of the Xkb extension is not available 1720in the server, <emphasis> 1721XkbGetAccessXTimeout</emphasis> 1722 returns <emphasis> 1723False</emphasis> 1724. 1725</para> 1726 1727 1728<para> 1729To configure the <emphasis> 1730AccessXTimeout</emphasis> 1731 options for a keyboard device, use <emphasis> 1732XkbSetAccessXTimeout</emphasis> 1733. 1734</para> 1735 1736 1737<informaltable frame='none'> 1738<?dbfo keep-together="always" ?> 1739<tgroup cols='1' align='left' colsep='0' rowsep='0'> 1740<colspec colname='c1' colwidth='1.0*'/> 1741<tbody> 1742 <row> 1743 <entry role='functiondecl'> 1744Bool <emphasis> 1745XkbSetAccessXTimeout</emphasis> 1746(<emphasis> 1747display</emphasis> 1748,<emphasis> 1749 device_spec, timeout, ctrls_mask, ctrls_values, opts_mask, 1750opts_values</emphasis> 1751) 1752 </entry> 1753 </row> 1754 <row> 1755 <entry role='functionargdecl'> 1756Display *<emphasis> 1757 display</emphasis> 1758; /* connection to X server */ 1759 </entry> 1760 </row> 1761 <row> 1762 <entry role='functionargdecl'> 1763unsigned int<emphasis> 1764 device_spec</emphasis> 1765; /* device to configure, or <emphasis> 1766XkbUseCoreKbd</emphasis> 1767 */ 1768 </entry> 1769 </row> 1770 <row> 1771 <entry role='functionargdecl'> 1772unsigned short <emphasis> 1773timeout</emphasis> 1774; /* seconds idle until AccessXTimeout occurs */ 1775 </entry> 1776 </row> 1777 <row> 1778 <entry role='functionargdecl'> 1779unsigned int<emphasis> 1780 ctrls_mask</emphasis> 1781; /* boolean controls to modify */ 1782 </entry> 1783 </row> 1784 <row> 1785 <entry role='functionargdecl'> 1786unsigned int<emphasis> 1787 ctrls_values</emphasis> 1788; /* new bits for controls selected by <emphasis> 1789ctrls_mask</emphasis> 1790 */ 1791 </entry> 1792 </row> 1793 <row> 1794 <entry role='functionargdecl'> 1795unsigned short <emphasis> 1796opts_mask</emphasis> 1797; /* <emphasis> 1798ax_options</emphasis> 1799 to change */ 1800 </entry> 1801 </row> 1802 <row> 1803 <entry role='functionargdecl'> 1804unsigned short <emphasis> 1805opts_values</emphasis> 1806; /* new bits for <emphasis> 1807ax_options</emphasis> 1808 selected by <emphasis> 1809opts_mask</emphasis> 1810 */ 1811 </entry> 1812</row> 1813</tbody> 1814</tgroup> 1815</informaltable> 1816 1817<para> 1818<emphasis> 1819timeout</emphasis> 1820 specifies the number of seconds the keyboard must be idle before the controls 1821are modified. <emphasis> 1822ctrls_mask</emphasis> 1823 specifies what controls are to be enabled or disabled, and <emphasis> 1824ctrls_values</emphasis> 1825 specifies whether those controls are to be enabled or disabled. The bit values 1826correspond to those for enabling and disabling boolean controls (see section 182710.1.1). The <emphasis> 1828opts_mask</emphasis> 1829 field specifies which attributes of the <emphasis> 1830AccessXKeys</emphasis> 1831 and <emphasis> 1832AccessXFeedback</emphasis> 1833 controls are to be changed, and <emphasis> 1834opts_values</emphasis> 1835 specifies the new values for those options. The bit values correspond to those 1836for the <emphasis> 1837ax_options</emphasis> 1838 field of an <emphasis> 1839XkbDescRec</emphasis> 1840 (see section 10.8). <!-- xref --> 1841</para> 1842 1843 1844<para> 1845<emphasis> 1846XkbSetAccessXTimeout</emphasis> 1847 sends a request to configure the <emphasis> 1848AccessXTimeout</emphasis> 1849 control to the server.<emphasis> 1850 </emphasis> 1851It does not wait for a reply, and normally returns <emphasis> 1852True</emphasis> 1853. If a compatible version of the Xkb extension is not available in the server, 1854<emphasis> 1855XkbSetAccessXTimeout</emphasis> 1856 returns <emphasis> 1857False</emphasis> 1858. 1859</para> 1860 1861 1862</sect2> 1863<sect2 id='The_AccessXFeedback_Control'> 1864<title>The AccessXFeedback Control</title> 1865 1866<para> 1867Just as some keyboards can produce keyclicks to indicate when a key is pressed 1868or repeating, Xkb can provide feedback for the controls by using special beep 1869codes. Use the <emphasis> 1870AccessXFeedback</emphasis> 1871 control to configure the specific types of operations that generate feedback. 1872</para> 1873 1874 1875<para> 1876There is no convenience function for modifying the <emphasis> 1877AccessXFeedback</emphasis> 1878 control, although the feedback as a whole can be enabled or disabled just as 1879other boolean controls are (see section 10.1). Individual beep codes are turned 1880on or off by modifying the following bits in the <emphasis> 1881ax_options</emphasis> 1882 field of an <emphasis> 1883XkbControlsRec</emphasis> 1884 structure and using <emphasis> 1885XkbSetControls</emphasis> 1886 (see section 10.10): <!-- xref --> 1887</para> 1888 1889<table frame='topbot'> 1890<title>AccessXFeedback Masks</title> 1891<?dbfo keep-together="always" ?> 1892<tgroup cols='3' align='left' colsep='0' rowsep='0'> 1893<colspec colname='c1' colwidth='1.0*'/> 1894<colspec colname='c2' colwidth='1.0*'/> 1895<colspec colname='c3' colwidth='1.0*'/> 1896<thead> 1897<row rowsep='1'> 1898 <entry>Action</entry> 1899 <entry>Beep Code</entry> 1900 <entry>ax_options bit</entry> 1901 </row> 1902</thead> 1903<tbody> 1904<row> 1905 <entry>LED turned on</entry> 1906 <entry>High-pitched beep</entry> 1907 <entry>XkbAX_IndicatorFBMask</entry> 1908</row> 1909<row> 1910 <entry>LED turned off</entry> 1911 <entry>Low-pitched beep</entry> 1912 <entry>XkbAX_IndicatorFBMask</entry> 1913</row> 1914<row> 1915 <entry>More than one LED changed state</entry> 1916 <entry>Two high-pitched beeps</entry> 1917 <entry>XkbAX_IndicatorFBMask</entry> 1918</row> 1919<row> 1920 <entry>Control turned on</entry> 1921 <entry>Rising tone</entry> 1922 <entry>XkbAX_FeatureFBMask</entry> 1923</row> 1924<row> 1925 <entry>Control turned off</entry> 1926 <entry>Falling tone</entry> 1927 <entry>XkbAX_FeatureFBMask</entry> 1928</row> 1929<row> 1930 <entry>More than one control changed state</entry> 1931 <entry>Two high-pitched beeps</entry> 1932 <entry>XkbAX_FeatureFBMask</entry> 1933</row> 1934<row> 1935 <entry>SlowKeys and BounceKeys about to be turned on or off</entry> 1936 <entry>Three high-pitched beeps</entry> 1937 <entry>XkbAX_SlowWarnFBMask</entry> 1938</row> 1939<row> 1940 <entry>SlowKeys key pressed</entry> 1941 <entry>Medium-pitched beep</entry> 1942 <entry>XkbAX_SKPressFBMask</entry> 1943</row> 1944<row> 1945 <entry>SlowKeys key accepted</entry> 1946 <entry>Medium-pitched beep</entry> 1947 <entry>XkbAX_SKAcceptFBMask</entry> 1948</row> 1949<row> 1950 <entry>SlowKeys key rejected</entry> 1951 <entry>Low-pitched beep</entry> 1952 <entry>XkbAX_SKRejectFBMask</entry> 1953</row> 1954<row> 1955 <entry>Accepted SlowKeys key released</entry> 1956 <entry>Medium-pitched beep</entry> 1957 <entry>XkbAX_SKReleaseFBMask</entry> 1958</row> 1959<row> 1960 <entry>BounceKeys key rejected</entry> 1961 <entry>Low-pitched beep</entry> 1962 <entry>XkbAX_BKRejectFBMask</entry> 1963</row> 1964<row> 1965 <entry>StickyKeys key latched</entry> 1966 <entry>Low-pitched beep followed by high-pitched beep</entry> 1967 <entry>XkbAX_StickyKeysFBMask</entry> 1968</row> 1969<row> 1970 <entry>StickyKeys key locked</entry> 1971 <entry>High-pitched beep</entry> 1972 <entry>XkbAX_StickyKeysFBMask</entry> 1973</row> 1974<row> 1975 <entry>StickyKeys key unlocked</entry> 1976 <entry>Low-pitched beep</entry> 1977 <entry>XkbAX_StickyKeysFBMask</entry> 1978 </row> 1979</tbody> 1980</tgroup> 1981</table> 1982 1983<para> 1984Implementations that cannot generate continuous tones may generate multiple 1985beeps instead of falling and rising tones; for example, they can generate a 1986high-pitched beep followed by a low-pitched beep instead of a continuous 1987falling tone. Other implementations can only ring the bell with one fixed 1988pitch. In these cases, use the <emphasis> 1989XkbAX_DumbBellFBMask</emphasis> 1990 bit of <emphasis> 1991ax_options</emphasis> 1992 to indicate that the bell can only ring with a fixed pitch. 1993</para> 1994 1995 1996<para> 1997When any of the above feedbacks occur, Xkb may generate a <emphasis> 1998XkbBellNotify</emphasis> 1999 event (see section 9.4). <!-- xref --> 2000</para> 2001 2002 2003</sect2> 2004<sect2 id='AccessXNotify_Events'> 2005<title>AccessXNotify Events</title> 2006 2007<para> 2008The server can generate <emphasis> 2009XkbAccessXNotify</emphasis> 2010 events for some of the global keyboard controls. The structure for the 2011<emphasis> 2012XkbAccessXNotify</emphasis> 2013 event type is as follows: 2014</para> 2015 2016<para><programlisting> 2017typedef struct { 2018 int type; /* Xkb extension base event code */ 2019 unsigned long serial; /* X server serial number for event */ 2020 Bool send_event; /* <emphasis> True</emphasis> => synthetically generated */ 2021 Display * display; /* server connection where event generated */ 2022 Time time; /* server time when event generated */ 2023 int xkb_type; /* <emphasis> XkbAccessXNotify</emphasis> */ 2024 int device; /* Xkb device ID, will not be <emphasis> XkbUseCoreKbd</emphasis> */ 2025 int detail; /* XkbAXN_* */ 2026 KeyCode keycode; /* key of event */ 2027 int slowKeysDelay; /* current SlowKeys delay */ 2028 int debounceDelay; /* current debounce delay */ 2029} <emphasis>XkbAccessXNotifyEvent</emphasis>; 2030</programlisting></para> 2031 2032<para> 2033The <emphasis> 2034detail</emphasis> 2035 field describes what AccessX event just occurred and can be any of the values 2036in Table 10.4. <!-- xref --> 2037</para> 2038 2039<table frame='topbot'> 2040<title>AccessXNotify Events</title> 2041<?dbfo keep-together="always" ?> 2042<tgroup cols='2' align='left' colsep='0' rowsep='0'> 2043<colspec colname='c1' colwidth='1.0*'/> 2044<colspec colname='c2' colwidth='2.0*'/> 2045<thead> 2046<row rowsep='1'> 2047 <entry>detail</entry> 2048 <entry>Reason</entry> 2049</row> 2050</thead> 2051<tbody> 2052<row> 2053 <entry>XkbAXN_SKPress</entry> 2054 <entry>A key was pressed when SlowKeys was enabled.</entry> 2055</row> 2056<row> 2057 <entry>XkbAXN_SKAccept</entry> 2058 <entry>A key was accepted (held longer than the SlowKeys delay).</entry> 2059</row> 2060<row> 2061 <entry>XkbAXN_SKRelease</entry> 2062 <entry>An accepted SlowKeys key was released.</entry> 2063</row> 2064<row> 2065 <entry>XkbAXN_SKReject</entry> 2066 <entry>A key was rejected (released before the SlowKeys delay 2067expired).</entry> 2068</row> 2069<row> 2070 <entry>XkbAXN_BKAccept</entry> 2071 <entry>A key was accepted by BounceKeys.</entry> 2072</row> 2073<row> 2074 <entry>XkbAXN_BKReject</entry> 2075 <entry>A key was rejected (pressed before the BounceKeys delay 2076expired).</entry> 2077</row> 2078<row> 2079 <entry>XkbAXN_AXKWarning</entry> 2080 <entry>AccessXKeys is about to turn on/off StickyKeys or BounceKeys.</entry> 2081 </row> 2082</tbody> 2083</tgroup> 2084</table> 2085 2086<para> 2087The <emphasis> 2088keycode</emphasis> 2089 field reports the keycode of the key for which the event occurred. If the 2090action is related to <emphasis> 2091SlowKeys</emphasis> 2092, the <emphasis> 2093slowKeysDelay</emphasis> 2094 field contains the current <emphasis> 2095SlowKeys</emphasis> 2096 acceptance delay. If the action is related to <emphasis> 2097BounceKeys</emphasis> 2098, the <emphasis> 2099debounceDelay</emphasis> 2100 field contains the current <emphasis> 2101BounceKeys</emphasis> 2102 debounce delay. 2103</para> 2104 2105<sect3 id='Selecting_for_AccessX_Events'> 2106<title>Selecting for AccessX Events</title> 2107 2108<para> 2109To receive <emphasis> 2110XkbAccessXNotify</emphasis> 2111 events under all possible conditions, use <emphasis> 2112XkbSelectEvents</emphasis> 2113 (see section 4.3) and pass <emphasis> <!-- xref --> 2114XkbAccesXNotifyMask</emphasis> 2115 in both <emphasis> 2116bits_to_change</emphasis> 2117 and <emphasis> 2118values_for_bits</emphasis> 2119. 2120</para> 2121 2122 2123<para> 2124To receive <emphasis> 2125XkbStateNotify</emphasis> 2126 events only under certain conditions, use <emphasis> 2127XkbSelectEventDetails</emphasis> 2128 using <emphasis> 2129XkbAccessXNotify</emphasis> 2130 as the <emphasis> 2131event_type</emphasis> 2132 and specifying the desired state changes in <emphasis> 2133bits_to_change</emphasis> 2134 and <emphasis> 2135values_for_bits</emphasis> 2136 using mask bits from Table 10.5. <!-- xref --> 2137</para> 2138 2139<table frame='topbot'> 2140<title>AccessXNotify Event Details</title> 2141<?dbfo keep-together="always" ?> 2142<tgroup cols='3' align='left' colsep='0' rowsep='0'> 2143<colspec colname='c1' colwidth='1.5*'/> 2144<colspec colname='c2' colwidth='1.0*'/> 2145<colspec colname='c3' colwidth='2.0*'/> 2146<thead> 2147<row rowsep='1'> 2148 <entry>XkbAccessXNotify Event Details</entry> 2149 <entry>Value</entry> 2150 <entry>Circumstances</entry> 2151 </row> 2152</thead> 2153<tbody> 2154 <row> 2155 <entry>XkbAXN_SKPressMask</entry> 2156 <entry>(1<<0)</entry> 2157 <entry>Slow key press notification wanted</entry> 2158 </row> 2159 <row> 2160 <entry>XkbAXN_SKAcceptMask</entry> 2161 <entry>(1<<1)</entry> 2162 <entry>Slow key accept notification wanted</entry> 2163 </row> 2164 <row> 2165 <entry>XkbAXN_SKRejectMask</entry> 2166 <entry>(1<<2)</entry> 2167 <entry>Slow key reject notification wanted</entry> 2168 </row> 2169 <row> 2170 <entry>XkbAXN_SKReleaseMask</entry> 2171 <entry>(1<<3)</entry> 2172 <entry>Slow key release notification wanted</entry> 2173 </row> 2174 <row> 2175 <entry>XkbAXN_BKAcceptMask</entry> 2176 <entry>(1<<4)</entry> 2177 <entry>Bounce key accept notification wanted</entry> 2178 </row> 2179 <row> 2180 <entry>XkbAXN_BKRejectMask</entry> 2181 <entry>(1<<5)</entry> 2182 <entry>Bounce key reject notification wanted</entry> 2183 </row> 2184 <row> 2185 <entry>XkbAXN_AXKWarningMask</entry> 2186 <entry>(1<<6)</entry> 2187 <entry>AccessX warning notification wanted</entry> 2188 </row> 2189 <row> 2190 <entry>XkbAXN_AllEventsMask</entry> 2191 <entry>(0x7f)</entry> 2192 <entry>All AccessX features notifications wanted</entry> 2193 </row> 2194</tbody> 2195</tgroup> 2196</table> 2197 2198</sect3> 2199</sect2> 2200<sect2 id='StickyKeys_RepeatKeys_and_MouseKeys_Events'> 2201<title>StickyKeys, RepeatKeys, and MouseKeys Events</title> 2202 2203<para> 2204The <emphasis> 2205StickyKeys</emphasis> 2206, <emphasis> 2207RepeatKeys</emphasis> 2208, and <emphasis> 2209MouseKeys</emphasis> 2210 controls do not generate specific events. Instead, the latching, unlatching, 2211locking, or unlocking of modifiers using <emphasis> 2212StickyKeys</emphasis> 2213 generates <emphasis> 2214XkbStateNotify</emphasis> 2215 events as described in section 5.4. Repeating keys generate normal <emphasis> <!-- xref --> 2216KeyPress</emphasis> 2217 and <emphasis> 2218KeyRelease</emphasis> 2219 events, though the auto-repeat can be detected using <emphasis> 2220DetectableAutorepeat</emphasis> 2221 (see section 10.3.3). Finally, <emphasis> <!-- xref --> 2222MouseKeys</emphasis> 2223 generates pointer events identical to those of the core pointer device. 2224</para> 2225 2226 2227</sect2> 2228<sect2 id='The_SlowKeys_Control'> 2229<title>The SlowKeys Control</title> 2230 2231<para> 2232Some users may accidentally bump keys while moving a hand or typing stick 2233toward the key they want. Usually, the keys that are accidentally bumped are 2234just hit for a very short period of time. The <emphasis> 2235SlowKeys</emphasis> 2236 control helps filter these accidental bumps by telling the server to wait a 2237specified period, called the <emphasis> 2238SlowKeys acceptance delay</emphasis> 2239, before delivering key events. If the key is released before this period 2240elapses, no key events are generated. Users can then bump any number of keys on 2241their way to the one they want without accidentally getting those characters. 2242Once they have reached the key they want, they can then hold the desired key 2243long enough for the computer to accept it. <emphasis> 2244SlowKeys</emphasis> 2245 is a boolean control with one configurable attribute. 2246</para> 2247 2248<para> 2249When the <emphasis> 2250SlowKeys</emphasis> 2251 control is active, the server reports the initial key press, subsequent 2252acceptance or rejection, and release of any key to interested clients by 2253sending an appropriate <emphasis> 2254AccessXNotify</emphasis> 2255 event (see section 10.6.4). <!-- xref --> 2256</para> 2257 2258<para> 2259To get the <emphasis> 2260SlowKeys</emphasis> 2261 acceptance delay for a keyboard device, use <emphasis> 2262XkbGetSlowKeysDelay</emphasis> 2263. 2264</para> 2265 2266<informaltable frame='none'> 2267<?dbfo keep-together="always" ?> 2268<tgroup cols='1' align='left' colsep='0' rowsep='0'> 2269<colspec colname='c1' colwidth='1.0*'/> 2270<tbody> 2271 <row> 2272 <entry role='functiondecl'> 2273Bool <emphasis> 2274XkbGetSlowKeysDelay</emphasis> 2275(<emphasis> 2276display</emphasis> 2277,<emphasis> 2278 device_spec</emphasis> 2279,<emphasis> 2280 delay_rtrn</emphasis> 2281) 2282 </entry> 2283 </row> 2284 <row> 2285 <entry role='functionargdecl'> 2286Display *<emphasis> 2287 display</emphasis> 2288; /* connection to X server */ 2289 </entry> 2290 </row> 2291 <row> 2292 <entry role='functionargdecl'> 2293unsigned int <emphasis> 2294device_spec</emphasis> 2295; /* device ID, or <emphasis> 2296XkbUseCoreKbd</emphasis> 2297 */ 2298 </entry> 2299 </row> 2300 <row> 2301 <entry role='functionargdecl'> 2302unsigned int * <emphasis> 2303delay_rtrn</emphasis> 2304; /* backfilled with <emphasis> 2305SlowKeys</emphasis> 2306 delay, ms */ 2307 </entry> 2308</row> 2309</tbody> 2310</tgroup> 2311</informaltable> 2312 2313<para> 2314<emphasis> 2315XkbGetSlowKeysDelay </emphasis> 2316requests the attributes of the <emphasis> 2317SlowKeys</emphasis> 2318 control from the server, waits for a reply and backfills <emphasis> 2319delay_rtrn </emphasis> 2320with the <emphasis> 2321SlowKeys</emphasis> 2322 delay attribute. <emphasis> 2323XkbGetSlowKeysDelay </emphasis> 2324returns <emphasis> 2325True</emphasis> 2326 if successful; if a compatible version of the Xkb extension is not available 2327in the server, <emphasis> 2328XkbGetSlowKeysDelay</emphasis> 2329 returns <emphasis> 2330False</emphasis> 2331. 2332</para> 2333 2334 2335<para> 2336To set the <emphasis> 2337SlowKeys</emphasis> 2338 acceptance delay for a keyboard device, use <emphasis> 2339XkbSetSlowKeysDelay</emphasis> 2340. 2341</para> 2342 2343 2344<informaltable frame='none'> 2345<?dbfo keep-together="always" ?> 2346<tgroup cols='1' align='left' colsep='0' rowsep='0'> 2347<colspec colname='c1' colwidth='1.0*'/> 2348<tbody> 2349 <row> 2350 <entry role='functiondecl'> 2351Bool <emphasis> 2352XkbSetSlowKeysDelay</emphasis> 2353(<emphasis> 2354display</emphasis> 2355,<emphasis> 2356 device_spec</emphasis> 2357,<emphasis> 2358 delay</emphasis> 2359) 2360 </entry> 2361 </row> 2362 <row> 2363 <entry role='functionargdecl'> 2364Display *<emphasis> 2365 display</emphasis> 2366; /* connection to X server */ 2367 </entry> 2368 </row> 2369 <row> 2370 <entry role='functionargdecl'> 2371unsigned int <emphasis> 2372device_spec</emphasis> 2373; /* device to configure, or <emphasis> 2374XkbUseCoreKbd</emphasis> 2375 */ 2376 </entry> 2377 </row> 2378 <row> 2379 <entry role='functionargdecl'> 2380unsigned int <emphasis> 2381delay</emphasis> 2382; /* <emphasis> 2383SlowKeys</emphasis> 2384 delay, ms */ 2385 </entry> 2386</row> 2387</tbody> 2388</tgroup> 2389</informaltable> 2390 2391<para> 2392<emphasis> 2393XkbSetSlowKeysDelay</emphasis> 2394 sends a request to configure the <emphasis> 2395SlowKeys</emphasis> 2396 control to the server.<emphasis> 2397 </emphasis> 2398It does not wait for a reply, and normally returns <emphasis> 2399True</emphasis> 2400. Specifying a value of <emphasis> 24010</emphasis> 2402 for the <emphasis> 2403delay </emphasis> 2404parameter causes <emphasis> 2405XkbSetSlowKeys</emphasis> 2406 to generate a <emphasis> 2407BadValue</emphasis> 2408 protocol error. If a compatible version of the Xkb extension is not available 2409in the server <emphasis> 2410XkbSetSlowKeysDelay</emphasis> 2411 returns <emphasis> 2412False</emphasis> 2413. 2414</para> 2415 2416 2417</sect2> 2418<sect2 id='The_BounceKeys_Control'> 2419<title>The BounceKeys Control</title> 2420 2421<para> 2422Some users may accidentally "bounce" on a key when they release it. They press 2423it once, then accidentally press it again after they release it. The <emphasis> 2424BounceKeys</emphasis> 2425 control temporarily disables a key after it has been pressed, effectively 2426"debouncing" the keyboard. The period of time the key is disabled after it is 2427released is known as the <emphasis> 2428BounceKeys delay</emphasis> 2429. <emphasis> 2430BounceKeys</emphasis> 2431 is a boolean control. 2432</para> 2433 2434 2435<para> 2436When the <emphasis> 2437BounceKeys</emphasis> 2438 control is active, the server reports acceptance or rejection of any key to 2439interested clients by sending an appropriate <emphasis> 2440AccessXNotify</emphasis> 2441 event (see section 10.6.4). <!-- xref --> 2442</para> 2443 2444 2445<para> 2446Use <emphasis> 2447XkbGetBounceKeysDelay</emphasis> 2448 to query the current <emphasis> 2449BounceKeys</emphasis> 2450 delay for a keyboard device. 2451</para> 2452 2453<informaltable frame='none'> 2454<?dbfo keep-together="always" ?> 2455<tgroup cols='1' align='left' colsep='0' rowsep='0'> 2456<colspec colname='c1' colwidth='1.0*'/> 2457<tbody> 2458 <row> 2459 <entry role='functiondecl'> 2460Bool <emphasis> 2461XkbGetBounceKeysDelay</emphasis> 2462(<emphasis> 2463display</emphasis> 2464,<emphasis> 2465 device_spec</emphasis> 2466,<emphasis> 2467 delay_rtrn</emphasis> 2468) 2469 </entry> 2470 </row> 2471 <row> 2472 <entry role='functionargdecl'> 2473Display *<emphasis> 2474 display</emphasis> 2475; /* connection to X server */ 2476 </entry> 2477 </row> 2478 <row> 2479 <entry role='functionargdecl'> 2480unsigned int <emphasis> 2481device_spec</emphasis> 2482; /* device ID, or <emphasis> 2483XkbUseCoreKbd</emphasis> 2484 */ 2485 </entry> 2486 </row> 2487 <row> 2488 <entry role='functionargdecl'> 2489unsigned int * <emphasis> 2490delay_rtrn</emphasis> 2491; /* backfilled with bounce keys delay, ms */ 2492 </entry> 2493</row> 2494</tbody> 2495</tgroup> 2496</informaltable> 2497 2498<para> 2499<emphasis> 2500XkbGetBounceKeysDelay </emphasis> 2501requests the attributes of the <emphasis> 2502BounceKeys</emphasis> 2503 control from the server, waits for a reply, and backfills <emphasis> 2504delay_rtrn </emphasis> 2505with the <emphasis> 2506BounceKeys</emphasis> 2507 delay attribute. <emphasis> 2508XkbGetBounceKeysDelay </emphasis> 2509returns<emphasis> 2510 </emphasis> 2511<emphasis> 2512True</emphasis> 2513 if successful; if a compatible version of the Xkb extension is not available 2514in the server <emphasis> 2515XkbGetSlowKeysDelay</emphasis> 2516 returns <emphasis> 2517False</emphasis> 2518. 2519</para> 2520 2521 2522<para> 2523To set the <emphasis> 2524BounceKeys</emphasis> 2525 delay for a keyboard device, use <emphasis> 2526XkbSetBounceKeysDelay</emphasis> 2527. 2528</para> 2529 2530 2531<informaltable frame='none'> 2532<?dbfo keep-together="always" ?> 2533<tgroup cols='1' align='left' colsep='0' rowsep='0'> 2534<colspec colname='c1' colwidth='1.0*'/> 2535<tbody> 2536 <row> 2537 <entry role='functiondecl'> 2538Bool <emphasis> 2539XkbSetBounceKeysDelay</emphasis> 2540(<emphasis> 2541display</emphasis> 2542,<emphasis> 2543 device_spec</emphasis> 2544,<emphasis> 2545 delay</emphasis> 2546) 2547 </entry> 2548 </row> 2549 <row> 2550 <entry role='functionargdecl'> 2551Display *<emphasis> 2552 display</emphasis> 2553; /* connection to X server */ 2554 </entry> 2555 </row> 2556 <row> 2557 <entry role='functionargdecl'> 2558unsigned int<emphasis> 2559 device_spec</emphasis> 2560; /* device to configure, or <emphasis> 2561XkbUseCoreKbd</emphasis> 2562 */ 2563 </entry> 2564 </row> 2565 <row> 2566 <entry role='functionargdecl'> 2567unsigned int <emphasis> 2568delay</emphasis> 2569; /* bounce keys delay, ms */ 2570 </entry> 2571</row> 2572</tbody> 2573</tgroup> 2574</informaltable> 2575 2576<para> 2577<emphasis> 2578XkbSetBounceKeysDelay</emphasis> 2579 sends a request to configure the <emphasis> 2580BounceKeys</emphasis> 2581 control to the server.<emphasis> 2582 </emphasis> 2583It does not wait for a reply and normally returns <emphasis> 2584True</emphasis> 2585. Specifying a value of <emphasis> 2586zero </emphasis> 2587for the <emphasis> 2588delay </emphasis> 2589parameter causes <emphasis> 2590XkbSetBounceKeysDelay</emphasis> 2591 to generate a <emphasis> 2592BadValue</emphasis> 2593 protocol error. If a compatible version of the Xkb extension is not available 2594in the server, <emphasis> 2595XkbSetBounceKeysDelay</emphasis> 2596 returns <emphasis> 2597False</emphasis> 2598. 2599</para> 2600 2601</sect2> 2602<sect2 id='The_StickyKeys_Control'> 2603<title>The StickyKeys Control</title> 2604 2605<para> 2606Some people find it difficult or even impossible to press two keys at once. For 2607example, a one-fingered typist or someone using a mouth stick cannot press the 2608<emphasis> 2609Shift</emphasis> 2610 and <emphasis> 26111</emphasis> 2612 keys at the same time. The <emphasis> 2613StickyKeys</emphasis> 2614 control solves this problem by changing the behavior of the modifier keys. 2615With <emphasis> 2616StickyKeys</emphasis> 2617, the user can first press a modifier, release it, then press another key. For 2618example, to get an exclamation point on a PC-style keyboard, the user can press 2619the <emphasis> 2620Shift</emphasis> 2621 key, release it, and then press the <emphasis> 26221</emphasis> 2623 key. 2624</para> 2625 2626 2627<para> 2628<emphasis> 2629StickyKeys</emphasis> 2630 also allows users to lock modifier keys without requiring special locking 2631keys. When <emphasis> 2632StickyKeys</emphasis> 2633 is enabled, a modifier is latched when the user presses it just once. The user 2634can press a modifier twice in a row to lock it, and then unlock it by pressing 2635it one more time. 2636</para> 2637 2638 2639<para> 2640When a modifier is latched, it becomes unlatched when the user presses a 2641nonmodifier key or a pointer button. For instance, to enter the sequence 2642<emphasis> 2643Shift</emphasis> 2644+<emphasis> 2645Control</emphasis> 2646+<emphasis> 2647Z</emphasis> 2648 the user could press and release the <emphasis> 2649Shift</emphasis> 2650 key to latch it, then press and release the <emphasis> 2651Control</emphasis> 2652 key to latch it, and finally press and release the Z key. Because the 2653<emphasis> 2654Control</emphasis> 2655 key is a modifier key, pressing it does not unlatch the <emphasis> 2656Shift</emphasis> 2657 key. Thus, after the user presses the <emphasis> 2658Control</emphasis> 2659 key, both the <emphasis> 2660Shift</emphasis> 2661 and <emphasis> 2662Control</emphasis> 2663 modifiers are latched. When the user presses the <emphasis> 2664Z</emphasis> 2665 key, the effect is as though the user had pressed <emphasis> 2666Shift</emphasis> 2667+<emphasis> 2668Control</emphasis> 2669+<emphasis> 2670Z</emphasis> 2671. In addition, because the <emphasis> 2672Z</emphasis> 2673 key is not a modifier key, the <emphasis> 2674Shift</emphasis> 2675 and <emphasis> 2676Control</emphasis> 2677 modifiers are unlatched. 2678</para> 2679 2680 2681<para> 2682Locking a modifier key means that the modifier affects any key or pointer 2683button the user presses until the user unlocks it or it is unlocked 2684programmatically. For example, to enter the sequence ("XKB") on a keyboard 2685where ‘(’ is a shifted ‘9’, ‘)’ is a shifted ‘0’, and ‘"’ 2686is a shifted single quote, the user could press and release the <emphasis> 2687Shift</emphasis> 2688 key twice to lock the <emphasis> 2689Shift</emphasis> 2690 modifier. Then, when the user presses the <emphasis> 26919</emphasis> 2692, <emphasis> 2693‘</emphasis> 2694, <emphasis> 2695x</emphasis> 2696, <emphasis> 2697k</emphasis> 2698, <emphasis> 2699b</emphasis> 2700, <emphasis> 2701‘</emphasis> 2702, and <emphasis> 27030</emphasis> 2704 keys in sequence, it generates ("XKB"). To unlock the <emphasis> 2705Shift</emphasis> 2706 modifier, the user can press and release the <emphasis> 2707Shift</emphasis> 2708 key. 2709</para> 2710 2711 2712<para> 2713<emphasis>StickyKeys</emphasis> 2714 is a boolean control with two separate attributes that may be individually 2715configured: one to automatically disable it, and one to control the latching 2716behavior of modifier keys. 2717</para> 2718 2719<sect3 id='StickyKeys_Options'> 2720<title>StickyKeys Options</title> 2721 2722<para> 2723The <emphasis> 2724StickyKeys</emphasis> 2725 control has two options that can be accessed via the <emphasis> 2726ax_options</emphasis> 2727 of an <emphasis> 2728XkbControlsRec</emphasis> 2729 structure (see section 10.8). The first option, <emphasis> 2730TwoKeys</emphasis> 2731, specifies whether <emphasis> 2732StickyKeys</emphasis> 2733 should automatically turn off when two keys are pressed at the same time. This 2734feature is useful for shared computers so people who do not want them do not 2735need to turn <emphasis> 2736StickyKeys</emphasis> 2737 off if a previous user left <emphasis> 2738StickyKeys</emphasis> 2739 on. The second option, <emphasis> 2740LatchToLock</emphasis> 2741, specifies whether or not <emphasis> 2742StickyKeys</emphasis> 2743 locks a modifier when pressed twice in a row. 2744</para> 2745 2746 2747<para> 2748Use <emphasis> 2749XkbGetStickyKeysOptions</emphasis> 2750 to query the current <emphasis> 2751StickyKeys</emphasis> 2752 attributes for a keyboard device. 2753</para> 2754 2755<informaltable frame='none'> 2756<?dbfo keep-together="always" ?> 2757<tgroup cols='1' align='left' colsep='0' rowsep='0'> 2758<colspec colname='c1' colwidth='1.0*'/> 2759<tbody> 2760 <row> 2761 <entry role='functiondecl'> 2762Bool <emphasis> 2763XkbGetStickyKeysOptions</emphasis> 2764(<emphasis> 2765display</emphasis> 2766,<emphasis> 2767 device_spec</emphasis> 2768,<emphasis> 2769 options_rtrn</emphasis> 2770) 2771 </entry> 2772 </row> 2773 <row> 2774 <entry role='functionargdecl'> 2775Display *<emphasis> 2776 display</emphasis> 2777; /* connection to X server */ 2778 </entry> 2779 </row> 2780 <row> 2781 <entry role='functionargdecl'> 2782unsigned int <emphasis> 2783device_spec</emphasis> 2784; /* device ID, or <emphasis> 2785XkbUseCoreKbd</emphasis> 2786 */ 2787 </entry> 2788 </row> 2789 <row> 2790 <entry role='functionargdecl'> 2791unsigned int * <emphasis> 2792options_rtrn</emphasis> 2793; /* backfilled with StickyKeys option mask */ 2794 </entry> 2795</row> 2796</tbody> 2797</tgroup> 2798</informaltable> 2799 2800<para> 2801<emphasis> 2802XkbGetStickyKeysOptions </emphasis> 2803requests the attributes of the <emphasis> 2804StickyKeys</emphasis> 2805 control from the server, waits for a reply, and backfills <emphasis> 2806options_rtrn </emphasis> 2807with a mask indicating whether the individual <emphasis> 2808StickyKeys</emphasis> 2809 options are on or off. Valid bits in <emphasis> 2810options_rtrn</emphasis> 2811 are: 2812</para> 2813 2814<para> 2815<programlisting> 2816 <emphasis>XkbAX_TwoKeysMask</emphasis> 2817 <emphasis>XkbAX_LatchToLockMask</emphasis> 2818</programlisting> 2819</para> 2820 2821<para> 2822<emphasis> 2823XkbGetStickyKeysOptions </emphasis> 2824returns <emphasis> 2825True</emphasis> 2826 if successful; if a compatible version of the Xkb extension is not available 2827in the server <emphasis> 2828XkbGetStickyKeysOptions</emphasis> 2829 returns <emphasis> 2830False</emphasis> 2831. 2832</para> 2833 2834 2835<para> 2836To set the <emphasis> 2837StickyKeys</emphasis> 2838 attributes for a keyboard device, use <emphasis> 2839XkbSetStickyKeysOptions</emphasis> 2840. 2841</para> 2842 2843 2844<informaltable frame='none'> 2845<?dbfo keep-together="always" ?> 2846<tgroup cols='1' align='left' colsep='0' rowsep='0'> 2847<colspec colname='c1' colwidth='1.0*'/> 2848<tbody> 2849 <row> 2850 <entry role='functiondecl'> 2851Bool <emphasis> 2852XkbSetStickyKeysOptions</emphasis> 2853(<emphasis> 2854display</emphasis> 2855,<emphasis> 2856 device_spec, mask, values</emphasis> 2857) 2858 </entry> 2859 </row> 2860 <row> 2861 <entry role='functionargdecl'> 2862Display *<emphasis> 2863 display</emphasis> 2864; /* connection to X server */ 2865 </entry> 2866 </row> 2867 <row> 2868 <entry role='functionargdecl'> 2869unsigned int <emphasis> 2870device_spec</emphasis> 2871; /* device to configure, or XkbUseCoreKbd */ 2872 </entry> 2873 </row> 2874 <row> 2875 <entry role='functionargdecl'> 2876unsigned int <emphasis> 2877mask</emphasis> 2878; /* selects StickyKeys attributes to modify */ 2879 </entry> 2880 </row> 2881 <row> 2882 <entry role='functionargdecl'> 2883unsigned int <emphasis> 2884values;</emphasis> 2885 /* values for selected attributes */ 2886 </entry> 2887</row> 2888</tbody> 2889</tgroup> 2890</informaltable> 2891 2892<para> 2893<emphasis> 2894XkbSetStickyKeysOptions</emphasis> 2895 sends a request to configure the <emphasis> 2896StickyKeys</emphasis> 2897 control to the server.<emphasis> 2898 </emphasis> 2899It does not wait for a reply and normally returns <emphasis> 2900True</emphasis> 2901. The valid bits to use for both the <emphasis> 2902mask</emphasis> 2903 and <emphasis> 2904values</emphasis> 2905 parameters are: 2906</para> 2907 2908<para> 2909<programlisting> 2910 <emphasis>XkbAX_TwoKeysMask</emphasis> 2911 <emphasis>XkbAX_LatchToLockMask</emphasis> 2912</programlisting> 2913</para> 2914 2915<para> 2916 If a compatible version of the Xkb extension is not available in the server, 2917<emphasis> 2918XkbSetStickyKeysOptions</emphasis> 2919 returns <emphasis> 2920False</emphasis> 2921. 2922</para> 2923 2924</sect3> 2925</sect2> 2926</sect1> 2927<sect1 id='Controls_for_General_Keyboard_Mapping'> 2928<title>Controls for General Keyboard Mapping</title> 2929 2930<para> 2931There are several controls that apply to the keyboard mapping in general. They 2932control handling of out-of-range group indices and how modifiers are processed 2933and consumed in the server. These are: 2934</para> 2935 2936<para> 2937<programlisting> 2938 <emphasis>GroupsWrap</emphasis> 2939 <emphasis>IgnoreGroupLock</emphasis> 2940 <emphasis>IgnoreLockMods</emphasis> 2941 <emphasis>InternalMods </emphasis> 2942</programlisting> 2943</para> 2944 2945<para> 2946<emphasis> 2947IgnoreGroupLock</emphasis> 2948 is a boolean control; the rest are always active. 2949</para> 2950 2951 2952<para> 2953Without the modifier processing options provided by Xkb, passive grabs set via 2954translations in a client (for example, <emphasis> 2955Alt<KeyPress>space</emphasis> 2956) do not trigger if any modifiers other than those specified by the translation 2957are set. This results in problems in the user interface when either <emphasis> 2958NumLock</emphasis> 2959 or a secondary keyboard group is active. The <emphasis> 2960IgnoreLockMods</emphasis> 2961 and <emphasis> 2962IgnoreGroupLock</emphasis> 2963 controls make it possible to avoid this behavior without exhaustively 2964specifying a grab for every possible modifier combination. 2965</para> 2966 2967<sect2 id='The_GroupsWrap_Control'> 2968<title>The GroupsWrap Control</title> 2969 2970<para> 2971The <emphasis> 2972GroupsWrap</emphasis> 2973 control determines how illegal groups are handled on a global basis. There are 2974a number of valid keyboard sequences that can cause the effective group number 2975to go out of range. When this happens, the group must be normalized back to a 2976valid number. The <emphasis> 2977GroupsWrap</emphasis> 2978 control specifies how this is done. 2979</para> 2980 2981 2982<para> 2983When dealing with group numbers, all computations are done using the group 2984index, which is the group number minus one. There are three different 2985algorithms; the <emphasis> 2986GroupsWrap</emphasis> 2987 control specifies which one is used: 2988</para> 2989 2990<itemizedlist> 2991<listitem> 2992 <para>XkbRedirectIntoRange</para> 2993 <para> 2994All invalid group numbers are converted to a valid group number by taking the 2995last four bits of the <emphasis> 2996GroupsWrap</emphasis> 2997 control and using them as the group index. If the result is still out of 2998range, Group one is used. 2999 </para> 3000</listitem> 3001<listitem> 3002 <para> 3003XkbClampIntoRange 3004 </para> 3005 <para> 3006All invalid group numbers are converted to the nearest valid group number. 3007Group numbers larger than the highest supported group number are mapped to the 3008highest supported group; those less than one are mapped to group one. 3009 </para> 3010</listitem> 3011<listitem> 3012 <para>XkbWrapIntoRange</para> 3013 <para> 3014All invalid group numbers are converted to a valid group number using integer 3015modulus applied to the group index. 3016 </para> 3017</listitem> 3018</itemizedlist> 3019 3020<para> 3021There are no convenience functions for manipulating the <emphasis> 3022GroupsWrap</emphasis> 3023 control. Manipulate the <emphasis> 3024GroupsWrap</emphasis> 3025 control via the <emphasis> 3026groups_wrap</emphasis> 3027 field in the <emphasis> 3028XkbControlsRec</emphasis> 3029 structure, then use <emphasis> 3030XkbSetControls</emphasis> 3031 and <emphasis> 3032XkbGetControls</emphasis> 3033 (see section 10.9 and section 10.10) to query and change this control. <!-- xref --> 3034</para> 3035 3036<note><para>See also section 15.3.2 or a discussion of the related field, <!-- xref --> 3037<emphasis> 3038group_info</emphasis> 3039, which also normalizes a group under certain circumstances.</para></note> 3040 3041</sect2> 3042<sect2 id='The_IgnoreLockMods_Control'> 3043<title>The IgnoreLockMods Control</title> 3044 3045<para> 3046The core protocol does not provide a way to exclude specific modifiers from 3047grab calculations, with the result that locking modifiers sometimes have 3048unanticipated side effects. 3049</para> 3050 3051 3052<para> 3053The <emphasis> 3054IgnoreLockMods</emphasis> 3055 control specifies modifiers that should be excluded from grab calculations. 3056These modifiers are also not reported in any core events except <emphasis> 3057KeyPress</emphasis> 3058 and <emphasis> 3059KeyRelease</emphasis> 3060 events that do not activate a passive grab and that do not occur while a grab 3061is active. 3062</para> 3063 3064 3065<para> 3066Manipulate the <emphasis> 3067IgnoreLockMods</emphasis> 3068 control via the <emphasis> 3069ignore_lock</emphasis> 3070 field in the <emphasis> 3071XkbControlsRec</emphasis> 3072 structure, then use <emphasis> 3073XkbSetControls</emphasis> 3074 and <emphasis> 3075XkbGetControls</emphasis> 3076 (see sections 10.9 and 10.10) to query and change this control. Alternatively, <!-- xref --> 3077use <emphasis> 3078XkbSetIgnoreLockMods</emphasis> 3079. 3080</para> 3081 3082 3083<para> 3084To set the modifiers that, if locked, are not to be reported in matching events 3085to passive grabs, use <emphasis> 3086XkbSetIgnoreLockMods.</emphasis> 3087</para> 3088 3089<informaltable frame='none'> 3090<?dbfo keep-together="always" ?> 3091<tgroup cols='1' align='left' colsep='0' rowsep='0'> 3092<colspec colname='c1' colwidth='1.0*'/> 3093<tbody> 3094 <row> 3095 <entry role='functiondecl'> 3096Bool <emphasis> 3097XkbSetIgnoreLockMods</emphasis> 3098(<emphasis> 3099display, device_spec, affect_real, real_values, affect_virtual, 3100virtual_values</emphasis> 3101) 3102 </entry> 3103 </row> 3104 <row> 3105 <entry role='functionargdecl'> 3106Display * <emphasis> 3107display</emphasis> 3108; /* connection to the X server */ 3109 </entry> 3110 </row> 3111 <row> 3112 <entry role='functionargdecl'> 3113unsigned int <emphasis> 3114device_spec</emphasis> 3115; /* device ID, or <emphasis> 3116XkbUseCoreKbd</emphasis> 3117 */ 3118 </entry> 3119 </row> 3120 <row> 3121 <entry role='functionargdecl'> 3122unsigned int<emphasis> 3123 affect_real</emphasis> 3124; /* mask of real modifiers affected by this call */ 3125 </entry> 3126 </row> 3127 <row> 3128 <entry role='functionargdecl'> 3129unsigned int<emphasis> 3130 real_values</emphasis> 3131; /* values for affected real modifiers (1=>set, 0=>unset) */ 3132 </entry> 3133 </row> 3134 <row> 3135 <entry role='functionargdecl'> 3136unsigned int<emphasis> 3137 affect_virtual</emphasis> 3138; /* mask of virtual modifiers affected by this call */ 3139 </entry> 3140 </row> 3141 <row> 3142 <entry role='functionargdecl'> 3143unsigned int<emphasis> 3144 virtual_values</emphasis> 3145; /* values for affected virtual modifiers (1=>set, 0=>unset) 3146*/ 3147 </entry> 3148</row> 3149</tbody> 3150</tgroup> 3151</informaltable> 3152 3153<para> 3154<emphasis> 3155XkbSetIgnoreLockMods</emphasis> 3156 sends a request to the server to change the server’s <emphasis> 3157IgnoreLockMods</emphasis> 3158 control. <emphasis> 3159affect_real</emphasis> 3160 and <emphasis> 3161real_values</emphasis> 3162 are masks of real modifier bits indicating which real modifiers are to be 3163added and removed from the server’s <emphasis> 3164IgnoreLockMods</emphasis> 3165 control. Modifiers selected by both <emphasis> 3166affect_real</emphasis> 3167 and <emphasis> 3168real_values</emphasis> 3169 are added to the server’s <emphasis> 3170IgnoreLockMods</emphasis> 3171 control; those selected by <emphasis> 3172affect_real</emphasis> 3173 but not by <emphasis> 3174real_values</emphasis> 3175 are removed from the server’s <emphasis> 3176IgnoreLockMods</emphasis> 3177 control. Valid values for <emphasis> 3178affect_real</emphasis> 3179 and <emphasis> 3180real_values</emphasis> 3181 consist of any combination of the eight core modifier bits: <emphasis> 3182ShiftMask</emphasis> 3183, <emphasis> 3184LockMask</emphasis> 3185, <emphasis> 3186ControlMask</emphasis> 3187, <emphasis> 3188Mod1Mask</emphasis> 3189 - <emphasis> 3190Mod5Mask</emphasis> 3191. <emphasis> 3192affect_virtual</emphasis> 3193 and <emphasis> 3194virtual_values</emphasis> 3195 are masks of virtual modifier bits indicating which virtual modifiers are to 3196be added and removed from the server’s <emphasis> 3197IgnoreLockMods</emphasis> 3198 control. Modifiers selected by both <emphasis> 3199affect_virtual</emphasis> 3200 and <emphasis> 3201virtual_values</emphasis> 3202 are added to the server’s <emphasis> 3203IgnoreLockMods</emphasis> 3204 control; those selected by <emphasis> 3205affect_virtual</emphasis> 3206 but not by <emphasis> 3207virtual_values</emphasis> 3208 are removed from the server’s <emphasis> 3209IgnoreLockMods</emphasis> 3210 control.<emphasis> 3211 </emphasis> 3212See section 7.1 for a discussion of virtual modifier masks to use in <emphasis> <!-- xref --> 3213affect_virtual</emphasis> 3214 and <emphasis> 3215virtual_values</emphasis> 3216. <emphasis> 3217XkbSetIgnoreLockMods</emphasis> 3218 does not wait for a reply from the server. It returns <emphasis> 3219True</emphasis> 3220 if the request was sent, and <emphasis> 3221False</emphasis> 3222 otherwise. 3223</para> 3224 3225</sect2> 3226<sect2 id='The_IgnoreGroupLock_Control'> 3227<title>The IgnoreGroupLock Control</title> 3228 3229<para> 3230The <emphasis> 3231IgnoreGroupLock</emphasis> 3232 control is a boolean control with no attributes. If enabled, it specifies that 3233the locked state of the keyboard group should not be considered when activating 3234passive grabs. 3235</para> 3236 3237<para> 3238Because <emphasis> 3239IgnoreGroupLock</emphasis> 3240 is a boolean control with no attributes, use the general boolean controls 3241functions (see section 10.1) to change its state. <!-- xref --> 3242</para> 3243 3244 3245</sect2> 3246<sect2 id='The_InternalMods_Control'> 3247<title>The InternalMods Control</title> 3248 3249<para> 3250The core protocol does not provide any means to prevent a modifier from being 3251reported in events sent to clients; Xkb, however makes this possible via the 3252<emphasis> 3253InternalMods</emphasis> 3254 control. It specifies modifiers that should be consumed by the server and not 3255reported to clients. When a key is pressed and a modifier that has its bit set 3256in the <emphasis> 3257InternalMods</emphasis> 3258 control is reported to the server, the server uses the modifier when 3259determining the actions to apply for the key. The server then clears the bit, 3260so it is not actually reported to the client. In addition, modifiers specified 3261in the <emphasis> 3262InternalMods</emphasis> 3263 control are not used to determine grabs and are not used to calculate core 3264protocol compatibility state. 3265</para> 3266 3267 3268<para> 3269Manipulate the <emphasis> 3270InternalMods</emphasis> 3271 control via the <emphasis> 3272internal</emphasis> 3273 field in the <emphasis> 3274XkbControlsRec</emphasis> 3275 structure, using <emphasis> 3276XkbSetControls</emphasis> 3277 and <emphasis> 3278XkbGetControls</emphasis> 3279 (see sections10.9 and 10.10). Alternatively, use <emphasis> <!-- xref --> 3280XkbSetServerInternalMods</emphasis> 3281. 3282</para> 3283 3284 3285<para> 3286To set the modifiers that are consumed by the server before events are 3287delivered to the client, use <emphasis> 3288XkbSetServerInternalMods.</emphasis> 3289</para> 3290 3291<informaltable frame='none'> 3292<?dbfo keep-together="always" ?> 3293<tgroup cols='1' align='left' colsep='0' rowsep='0'> 3294<colspec colname='c1' colwidth='1.0*'/> 3295<tbody> 3296 <row> 3297 <entry role='functiondecl'> 3298Bool <emphasis> 3299XkbSetServerInternalMods</emphasis> 3300(<emphasis> 3301display, device_spec, affect_real, real_values, affect_virtual, 3302virtual_values</emphasis> 3303) 3304 </entry> 3305 </row> 3306 <row> 3307 <entry role='functionargdecl'> 3308Display * <emphasis> 3309display</emphasis> 3310; /* connection to the X server */ 3311 </entry> 3312 </row> 3313 <row> 3314 <entry role='functionargdecl'> 3315unsigned int <emphasis> 3316device_spec</emphasis> 3317;‘ /* device ID, or <emphasis> 3318XkbUseCoreKbd</emphasis> 3319 */ 3320 </entry> 3321 </row> 3322 <row> 3323 <entry role='functionargdecl'> 3324unsigned int<emphasis> 3325 affect_real</emphasis> 3326; /* mask of real modifiers affected by this call */ 3327 </entry> 3328 </row> 3329 <row> 3330 <entry role='functionargdecl'> 3331unsigned int<emphasis> 3332 real_values</emphasis> 3333; /* values for affected real modifiers (1=>set, 0=>unset) */ 3334 </entry> 3335 </row> 3336 <row> 3337 <entry role='functionargdecl'> 3338unsigned int<emphasis> 3339 affect_virtual</emphasis> 3340; /* mask of virtual modifiers affected by this call */ 3341 </entry> 3342 </row> 3343 <row> 3344 <entry role='functionargdecl'> 3345unsigned int<emphasis> 3346 virtual_values</emphasis> 3347; /* values for affected virtual modifiers (1=>set, 0=>unset) 3348*/ 3349 </entry> 3350</row> 3351</tbody> 3352</tgroup> 3353</informaltable> 3354 3355<para> 3356<emphasis> 3357XkbSetServerInternalMods</emphasis> 3358 sends a request to the server to change the internal modifiers consumed by the 3359server. <emphasis> 3360affect_real</emphasis> 3361 and <emphasis> 3362real_values</emphasis> 3363 are masks of real modifier bits indicating which real modifiers are to be 3364added and removed from the server’s internal modifiers control. Modifiers 3365selected by both <emphasis> 3366affect_real</emphasis> 3367 and <emphasis> 3368real_values</emphasis> 3369 are added to the server’s internal modifiers control; those selected by 3370<emphasis> 3371affect_real</emphasis> 3372 but not by <emphasis> 3373real_values</emphasis> 3374 are removed from the server’s internal modifiers mask. Valid values for 3375<emphasis> 3376affect_real</emphasis> 3377 and <emphasis> 3378real_values</emphasis> 3379 consist of any combination of the eight core modifier bits: <emphasis> 3380ShiftMask</emphasis> 3381, <emphasis> 3382LockMask</emphasis> 3383, <emphasis> 3384ControlMask</emphasis> 3385, <emphasis> 3386Mod1Mask</emphasis> 3387 - <emphasis> 3388Mod5Mask</emphasis> 3389.<emphasis> 3390 affect_virtual</emphasis> 3391 and <emphasis> 3392virtual_values</emphasis> 3393 are masks of virtual modifier bits indicating which virtual modifiers are to 3394be added and removed from the server’s internal modifiers control. Modifiers 3395selected by both <emphasis> 3396affect_virtual</emphasis> 3397 and <emphasis> 3398virtual_values</emphasis> 3399 are added to the server’s internal modifiers control; those selected by 3400<emphasis> 3401affect_virtual</emphasis> 3402 but not by <emphasis> 3403virtual_values</emphasis> 3404 are removed from the server’s internal modifiers control.<emphasis> 3405 </emphasis> 3406See section 7.1 for a discussion of virtual modifier masks to use in <emphasis> <!-- xref --> 3407affect_virtual</emphasis> 3408 and <emphasis> 3409virtual_values</emphasis> 3410.<emphasis> 3411 XkbSetServerInternalMods</emphasis> 3412 does not wait for a reply from the server. It returns <emphasis> 3413True</emphasis> 3414 if the request was sent and <emphasis> 3415False</emphasis> 3416 otherwise. 3417</para> 3418 3419 3420</sect2> 3421</sect1> 3422<sect1 id='The_XkbControlsRec_Structure'> 3423<title>The XkbControlsRec Structure</title> 3424 3425<para> 3426Many of the individual controls described in sections 10.1 through 10.7 may be 3427manipulated via convenience functions discussed in those sections. Some of 3428them, however, have no convenience functions. The <emphasis> 3429XkbControlsRec</emphasis> 3430 structure allows the manipulation of one or more of the controls in a single 3431operation and to track changes to any of them in conjunction with the <emphasis> 3432XkbGetControls</emphasis> 3433 and <emphasis> 3434XkbSetControls</emphasis> 3435 functions. This is the only way to manipulate those controls that have no 3436convenience functions. 3437</para> 3438 3439 3440<para> 3441The <emphasis> 3442XkbControlsRec</emphasis> 3443 structure is defined as follows: 3444</para> 3445 3446<para> 3447<programlisting> 3448#define XkbMaxLegalKeyCode 255 3449#define XkbPerKeyBitArraySize ((XkbMaxLegalKeyCode+1)/8) 3450</programlisting> 3451</para> 3452<para> 3453<programlisting> 3454typedef struct { 3455 unsigned char mk_dflt_btn; /* default button for keyboard driven mouse */ 3456 unsigned char num_groups; /* number of keyboard groups */ 3457 unsigned char groups_wrap; /* how to wrap out-of-bounds groups */ 3458 XkbModsRec internal; /* defines server internal modifiers */ 3459 XkbModsRec ignore_lock; /* modifiers to ignore when checking for grab */ 3460 unsigned int enabled_ctrls; /* 1 bit => corresponding boolean control enabled */ 3461 unsigned short repeat_delay; /* ms delay until first repeat */ 3462 unsigned short repeat_interval; /* ms delay between repeats */ 3463 unsigned short slow_keys_delay; /* ms minimum time key must be down to be ok */ 3464 unsigned short debounce_delay; /* ms delay before key reactivated */ 3465 unsigned short mk_delay; /* ms delay to second mouse motion event */ 3466 unsigned short mk_interval; /* ms delay between repeat mouse events */ 3467 unsigned short mk_time_to_max; /* # intervals until constant mouse move */ 3468 unsigned short mk_max_speed; /* multiplier for maximum mouse speed */ 3469 short mk_curve; /* determines mouse move curve type */ 3470 unsigned short ax_options; /* 1 bit => Access X option enabled */ 3471 unsigned short ax_timeout; /* seconds until Access X disabled */ 3472 unsigned short axt_opts_mask; /* 1 bit => options to reset on Access X timeout */ 3473 unsigned short axt_opts_values; /* 1 bit => turn option on, 0=> off */ 3474 unsigned int axt_ctrls_mask; /* which bits in <emphasis> enabled_ctrls</emphasis> to modify */ 3475 unsigned int axt_ctrls_values; /* values for new bits in <emphasis> enabled_ctrls</emphasis> */ 3476 unsigned char per_key_repeat[XkbPerKeyBitArraySize]; /* per key auto repeat */ 3477} <emphasis>XkbControlsRec</emphasis>, *XkbControlsPtr; 3478</programlisting> 3479</para> 3480 3481<para> 3482The general-purpose functions that work with the <emphasis> 3483XkbControlsRec</emphasis> 3484 structure use a mask to specify which controls are to be manipulated. Table 348510.6 lists these controls, the masks used to select them in the general 3486function calls (<emphasis> 3487which</emphasis> 3488 parameter), and the data fields in the <emphasis> 3489XkbControlsRec</emphasis> 3490 structure that comprise each of the individual controls. Also listed are the 3491bit used to turn boolean controls on and off and the section where each control 3492is described in more detail. 3493</para> 3494 3495<table frame='topbot'> 3496<title>Xkb Controls</title> 3497<?dbfo keep-together="auto" ?> 3498<tgroup cols='5' align='left' colsep='0' rowsep='0'> 3499<colspec colname='c1' colwidth='2.0*'/> 3500<colspec colname='c2' colwidth='3.1*'/> 3501<colspec colname='c3' colwidth='2.2*'/> 3502<colspec colname='c4' colwidth='2.6*'/> 3503<colspec colname='c5' colwidth='1.0*'/> 3504<thead> 3505<row rowsep='1'> 3506 <entry>Control</entry> 3507 <entry>Control Selection Mask (which parameter)</entry> 3508 <entry>Relevant XkbControlsRec Data Fields</entry> 3509 <entry>Boolean Control enabled_ctrls bit</entry> 3510 <entry>Section</entry> 3511 </row> 3512</thead> 3513<tbody> 3514 <row> 3515 <entry>AccessXFeedback</entry> 3516 <entry>XkbAccessXFeedbackMask</entry> 3517 <entry>ax_options: XkbAX_*FBMask</entry> 3518 <entry>XkbAccessXFeedback­Mask</entry> 3519 <entry>10.6.3</entry> <!-- xref --> 3520 </row> 3521 <row> 3522 <entry>AccessXKeys</entry> 3523 <entry></entry> 3524 <entry></entry> 3525 <entry>XkbAccessXKeys­Mask</entry> 3526 <entry>10.6.1</entry> <!-- xref --> 3527 </row> 3528 <row> 3529 <entry>AccessXTimeout</entry> 3530 <entry>XkbAccessXTimeoutMask</entry> 3531 <entry> 3532 <para>ax_timeout</para> 3533 <para>axt_opts_mask</para> 3534 <para>axt_opts_values</para> 3535 <para>axt_ctrls_mask</para> 3536 <para>axt_ctrls_values</para> 3537 </entry> 3538 <entry>XkbAccessXTimeout­Mask</entry> 3539 <entry>10.6.2</entry> 3540 </row> 3541 <row> 3542 <entry>AudibleBell</entry> 3543 <entry></entry> 3544 <entry></entry> 3545 <entry>XkbAudibleBellMask</entry> 3546 <entry>9.2</entry> 3547 </row> 3548 <row> 3549 <entry>AutoReset</entry> 3550 <entry></entry> 3551 <entry></entry> 3552 <entry></entry> 3553 <entry>10.1.2</entry> 3554 </row> 3555 <row> 3556 <entry>BounceKeys</entry> 3557 <entry>XkbBounceKeysMask</entry> 3558 <entry>debounce_delay</entry> 3559 <entry>XkbBounceKeysMask</entry> 3560 <entry>10.6.7</entry> 3561 </row> 3562 <row> 3563 <entry>Detectable-Autorepeat</entry> 3564 <entry></entry> 3565 <entry></entry> 3566 <entry></entry> 3567 <entry>10.3.3</entry> 3568 </row> 3569 <row> 3570 <entry>EnabledControls</entry> 3571 <entry>XkbControlsEnabledMask</entry> 3572 <entry>enabled_ctrls</entry> 3573 <entry><emphasis>Non-Boolean Control</emphasis></entry> 3574 <entry>10.1.1</entry> 3575 </row> 3576 <row> 3577 <entry>GroupsWrap</entry> 3578 <entry>XkbGroupsWrapMask</entry> 3579 <entry>groups_wrap</entry> 3580 <entry><emphasis>Non-Boolean Control</emphasis></entry> 3581 <entry>10.7.1</entry> 3582 </row> 3583 <row> 3584 <entry>IgnoreGroupLock</entry> 3585 <entry></entry> 3586 <entry></entry> 3587 <entry>XkbIgnoreGroupLock­Mask</entry> 3588 <entry>10.7.3</entry> 3589 </row> 3590 <row> 3591 <entry>IgnoreLockMods</entry> 3592 <entry>XkbIgnoreLockModsMask</entry> 3593 <entry>ignore_lock</entry> 3594 <entry><emphasis>Non-Boolean Control</emphasis></entry> 3595 <entry>5.1</entry> 3596 </row> 3597 <row> 3598 <entry>InternalMods</entry> 3599 <entry>XkbInternalModsMask</entry> 3600 <entry>internal</entry> 3601 <entry><emphasis>Non-Boolean Control</emphasis></entry> 3602 <entry>5.1</entry> 3603 </row> 3604 <row> 3605 <entry>MouseKeys</entry> 3606 <entry>XkbMouseKeysMask</entry> 3607 <entry>mk_dflt_btn</entry> 3608 <entry>XkbMouseKeysMask</entry> 3609 <entry>10.5.1</entry> 3610 </row> 3611 <row> 3612 <entry>MouseKeysAccel</entry> 3613 <entry>XkbMouseKeysAccelMask</entry> 3614 <entry> 3615 <para>mk_delay</para> 3616 <para>mk_interval</para> 3617 <para>mk_time_to_max</para> 3618 <para>mk_max_speed</para> 3619 <para>mk_curve</para> 3620 </entry> 3621 <entry>XkbMouseKeysAccel­Mask</entry> 3622 <entry>10.5.2</entry> 3623 </row> 3624 <row> 3625 <entry>Overlay1</entry> 3626 <entry></entry> 3627 <entry></entry> 3628 <entry>XkbOverlay1Mask</entry> 3629 <entry>10.4</entry> 3630 </row> 3631 <row> 3632 <entry>Overlay2</entry> 3633 <entry></entry> 3634 <entry></entry> 3635 <entry>XkbOverlay2Mask</entry> 3636 <entry>10.4</entry> 3637 </row> 3638 <row> 3639 <entry>PerKeyRepeat</entry> 3640 <entry>XkbPerKeyRepeatMask</entry> 3641 <entry>per_key_repeat</entry> 3642 <entry><emphasis>Non-Boolean Control</emphasis></entry> 3643 <entry>10.3.1</entry> 3644 </row> 3645 <row> 3646 <entry>RepeatKeys</entry> 3647 <entry>XkbRepeatKeysMask</entry> 3648 <entry> 3649 <para>repeat_delay</para> 3650 <para>repeat_interval</para> 3651 </entry> 3652 <entry>XkbRepeatKeysMask</entry> 3653 <entry>10.3</entry> 3654 </row> 3655 <row> 3656 <entry>SlowKeys</entry> 3657 <entry>XkbSlowKeysMask</entry> 3658 <entry>slow_keys_delay</entry> 3659 <entry>XkbSlowKeysMask</entry> 3660 <entry>10.6.6</entry> 3661 </row> 3662 <row> 3663 <entry>StickyKeys</entry> 3664 <entry>XkbStickyKeysMask</entry> 3665 <entry> 3666 <para>ax_options:</para> 3667 <para>XkbAX_Two­KeysMask</para> 3668 <para>XkbAX_Latch­ToLockMask</para> 3669 </entry> 3670 <entry>XkbStickyKeysMask</entry> 3671 <entry>10.6.8</entry> 3672 </row> 3673</tbody> 3674</tgroup> 3675</table> 3676 3677<para> 3678Table 10.7 shows the actual values for the individual mask bits used to select <!-- xref --> 3679controls for modification and to enable and disable the control. Note that the 3680same mask bit is used to specify general modifications to the parameters used 3681to configure the control (<emphasis> 3682which</emphasis> 3683), and to enable and disable the control (<emphasis> 3684enabled_ctrls</emphasis> 3685). The anomalies in the table (no "ok" in column) are for controls that have no 3686configurable attributes; and for controls that are not boolean controls and 3687therefore cannot be enabled or disabled. 3688</para> 3689 3690<table frame='topbot'> 3691<title>Controls Mask Bits</title> 3692<?dbfo keep-together="always" ?> 3693<tgroup cols='4' align='left' colsep='0' rowsep='0'> 3694<colspec colname='c1' colwidth='2.6*'/> 3695<colspec colname='c2' colwidth='2.0*'/> 3696<colspec colname='c3' colwidth='1.3*'/> 3697<colspec colname='c4' colwidth='2.0*'/> 3698<thead> 3699<row rowsep='1'> 3700 <entry>Mask Bit</entry> 3701 <entry>which or changed_ctrls</entry> 3702 <entry>enabled_ctrls</entry> 3703 <entry>Value</entry> 3704</row> 3705</thead> 3706<tbody> 3707<row> 3708 <entry>XkbRepeatKeysMask</entry> 3709 <entry>ok</entry> 3710 <entry>ok</entry> 3711 <entry>(1L<<0)</entry> 3712 </row> 3713 <row> 3714 <entry>XkbSlowKeysMask</entry> 3715 <entry>ok</entry> 3716 <entry>ok</entry> 3717 <entry>(1L<<1)</entry> 3718 </row> 3719 <row> 3720 <entry>XkbBounceKeysMask</entry> 3721 <entry>ok</entry> 3722 <entry>ok</entry> 3723 <entry>(1L<<2)</entry> 3724 </row> 3725 <row> 3726 <entry>XkbStickyKeysMask</entry> 3727 <entry>ok</entry> 3728 <entry>ok</entry> 3729 <entry>(1L<<3)</entry> 3730 </row> 3731 <row> 3732 <entry>XkbMouseKeysMask</entry> 3733 <entry>ok</entry> 3734 <entry>ok</entry> 3735 <entry>(1L<<4)</entry> 3736 </row> 3737 <row> 3738 <entry>XkbMouseKeysAccelMask</entry> 3739 <entry>ok</entry> 3740 <entry>ok</entry> 3741 <entry>(1L<<5)</entry> 3742 </row> 3743 <row> 3744 <entry>XkbAccessXKeysMask</entry> 3745 <entry>ok</entry> 3746 <entry>ok</entry> 3747 <entry>(1L<<6)</entry> 3748 </row> 3749 <row> 3750 <entry>XkbAccessXTimeoutMask</entry> 3751 <entry>ok</entry> 3752 <entry>ok</entry> 3753 <entry>(1L<<7)</entry> 3754 </row> 3755 <row> 3756 <entry>XkbAccessXFeedbackMask</entry> 3757 <entry>ok</entry> 3758 <entry>ok</entry> 3759 <entry>(1L<<8)</entry> 3760 </row> 3761 <row> 3762 <entry>XkbAudibleBellMask</entry> 3763 <entry></entry> 3764 <entry>ok</entry> 3765 <entry>(1L<<9)</entry> 3766 </row> 3767 <row> 3768 <entry>XkbOverlay1Mask</entry> 3769 <entry></entry> 3770 <entry>ok</entry> 3771 <entry>(1L<<10)</entry> 3772 </row> 3773 <row> 3774 <entry>XkbOverlay2Mask</entry> 3775 <entry></entry> 3776 <entry>ok</entry> 3777 <entry>(1L<<11)</entry> 3778 </row> 3779 <row> 3780 <entry>XkbIgnoreGroupLockMask</entry> 3781 <entry></entry> 3782 <entry>ok</entry> 3783 <entry>(1L<<12)</entry> 3784</row> 3785<row> 3786 <entry>XkbGroupsWrapMask</entry> 3787 <entry>ok</entry> 3788 <entry></entry> 3789 <entry>(1L<<27)</entry> 3790</row> 3791<row> 3792 <entry>XkbInternalModsMask</entry> 3793 <entry>ok</entry> 3794 <entry></entry> 3795 <entry>(1L<<28)</entry> 3796</row> 3797<row> 3798 <entry>XkbIgnoreLockModsMask</entry> 3799 <entry>ok</entry> 3800 <entry></entry> 3801 <entry>(1L<<29)</entry> 3802</row> 3803<row> 3804 <entry>XkbPerKeyRepeatMask</entry> 3805 <entry>ok</entry> 3806 <entry></entry> 3807 <entry>(1L<<30)</entry> 3808</row> 3809<row> 3810 <entry>XkbControlsEnabledMask</entry> 3811 <entry>ok</entry> 3812 <entry></entry> 3813 <entry>(1L<<31)</entry> 3814</row> 3815<row> 3816 <entry>XkbAccessXOptionsMask</entry> 3817 <entry>ok</entry> 3818 <entry>ok</entry> 3819 <entry>(XkbStickyKeysMask | XkbAccessXFeedbackMask)</entry> 3820 </row> 3821 <row> 3822 <entry>XkbAllBooleanCtrlsMask</entry> 3823 <entry></entry> 3824 <entry>ok</entry> 3825 <entry>(0x00001FFF) </entry> 3826 </row> 3827 <row> 3828 <entry>XkbAllControlsMask</entry> 3829 <entry>ok</entry> 3830 <entry></entry> 3831 <entry>(0xF8001FFF)</entry> 3832 </row> 3833</tbody> 3834</tgroup> 3835</table> 3836 3837<para> 3838The individual fields of the <emphasis> 3839XkbControlsRec</emphasis> 3840 structure are defined as follows. 3841</para> 3842 3843<sect2> 3844<title/> 3845<sect3 id='mk_dflt_btn'> 3846<title>mk_dflt_btn</title> 3847 3848<para> 3849<emphasis> 3850mk_dflt_btn is an attribute of the </emphasis> 3851<emphasis> 3852MouseKeys</emphasis> 3853<emphasis> 3854 control</emphasis> 3855 (see section 10.5<emphasis> <!-- xref --> 3856). It</emphasis> 3857 specifies the mouse button number to use for keyboard simulated mouse button 3858operations. Its value should be one of the core symbols <emphasis> 3859Button1</emphasis> 3860 - <emphasis> 3861Button5</emphasis> 3862. 3863</para> 3864 3865 3866</sect3> 3867<sect3 id='num_groups'> 3868<title>num_groups</title> 3869 3870<para> 3871<emphasis> 3872num_groups</emphasis> 3873 is not a part of any control, but is reported in the <emphasis> 3874XkbControlsRec</emphasis> 3875 structure whenever any of its components are fetched from the server. It 3876reports the number of groups the particular keyboard configuration uses and is 3877computed automatically by the server whenever the keyboard mapping changes. 3878</para> 3879 3880 3881</sect3> 3882<sect3 id='groups_wrap'> 3883<title>groups_wrap</title> 3884 3885<para> 3886<emphasis> 3887groups_wrap</emphasis> 3888 is an attribute of the <emphasis> 3889GroupsWrap</emphasis> 3890 control (see section 10.7.1). It specifies the handling of illegal groups on a <!-- xref --> 3891global basis. Valid values for <emphasis> 3892groups_wrap</emphasis> 3893 are shown in Table 10.8. 3894</para> 3895 3896<table frame='topbot'> 3897<title>GroupsWrap options (groups_wrap field)</title> 3898<?dbfo keep-together="always" ?> 3899<tgroup cols='2' align='left' colsep='0' rowsep='0'> 3900<colspec colname='c1' colwidth='1.0*'/> 3901<colspec colname='c2' colwidth='1.0*'/> 3902<thead> 3903<row rowsep='1'> 3904 <entry>groups_wrap symbolic name</entry> 3905 <entry>value</entry> 3906 </row> 3907</thead> 3908<tbody> 3909 <row> 3910 <entry>XkbWrapIntoRange</entry> 3911 <entry>(0x00)</entry> 3912 </row> 3913 <row> 3914 <entry>XkbClampIntoRange</entry> 3915 <entry>(0x40)</entry> 3916 </row> 3917 <row> 3918 <entry>XkbRedirectIntoRange</entry> 3919 <entry>(0x80)</entry> 3920 </row> 3921</tbody> 3922</tgroup> 3923</table> 3924 3925<para> 3926When <emphasis> 3927groups_wrap</emphasis> 3928 is set to <emphasis> 3929XkbRedirectIntoRange</emphasis> 3930, its four low-order bits specify the index of the group to use. 3931</para> 3932 3933 3934</sect3> 3935<sect3 id='internal'> 3936<title>internal</title> 3937 3938<para> 3939<emphasis> 3940internal</emphasis> 3941 is an attribute of the <emphasis> 3942InternalMods</emphasis> 3943 control (see section 10.7.4). It specifies modifiers to be consumed in the <!-- xref --> 3944server and not passed on to clients when events are reported. Valid values 3945consist of any combination of the eight core modifier bits: <emphasis> 3946ShiftMask</emphasis> 3947, <emphasis> 3948LockMask</emphasis> 3949, <emphasis> 3950ControlMask</emphasis> 3951, <emphasis> 3952Mod1Mask</emphasis> 3953 - <emphasis> 3954Mod5Mask</emphasis> 3955. 3956</para> 3957 3958 3959</sect3> 3960<sect3 id='ignore_lock'> 3961<title>ignore_lock</title> 3962 3963<para> 3964<emphasis> 3965ignore_lock</emphasis> 3966 is an attribute of the <emphasis> 3967IgnoreLockMods</emphasis> 3968 control (see section 10.7.2). It specifies modifiers to be ignored in grab <!-- xref --> 3969calculations. Valid values consist of any combination of the eight core 3970modifier bits: <emphasis> 3971ShiftMask</emphasis> 3972, <emphasis> 3973LockMask</emphasis> 3974, <emphasis> 3975ControlMask</emphasis> 3976, <emphasis> 3977Mod1Mask</emphasis> 3978 - <emphasis> 3979Mod5Mask</emphasis> 3980. 3981</para> 3982 3983 3984</sect3> 3985<sect3 id='enabled_ctrls'> 3986<title>enabled_ctrls</title> 3987 3988<para> 3989<emphasis> 3990enabled_ctrls</emphasis> 3991 is an attribute of the <emphasis> 3992EnabledControls</emphasis> 3993 control (see section 10.1.1). It contains one bit per boolean control. Each <!-- xref --> 3994bit determines whether the corresponding control is enabled or disabled; a one 3995bit means the control is enabled. The mask bits used to enable these controls 3996are listed in Table 10.7, using only those masks with "ok" in the <emphasis> 3997enabled_ctrls</emphasis> 3998 column. 3999</para> 4000 4001 4002</sect3> 4003<sect3 id='repeat_delay_and_repeat_interval'> 4004<title>repeat_delay and repeat_interval</title> 4005 4006<para> 4007<emphasis> 4008repeat_delay</emphasis> 4009 and <emphasis> 4010repeat_interval</emphasis> 4011 are attributes of the <emphasis> 4012RepeatKeys</emphasis> 4013 control (see section 10.3.2). <emphasis> <!-- xref --> 4014repeat_delay</emphasis> 4015 is the initial delay before a key begins repeating, in milliseconds; <emphasis> 4016repeat_interval</emphasis> 4017 is the delay between subsequent key events, in milliseconds. 4018</para> 4019 4020 4021</sect3> 4022<sect3 id='slow_keys_delay'> 4023<title>slow_keys_delay</title> 4024 4025<para> 4026<emphasis> 4027slow_keys_delay</emphasis> 4028 is an attribute of the <emphasis> 4029SlowKeys</emphasis> 4030 control (see section 10.6.6). Its value specifies the <emphasis> <!-- xref --> 4031SlowKeys</emphasis> 4032 acceptance delay period in milliseconds before a key press is accepted by the 4033server. 4034</para> 4035 4036 4037</sect3> 4038<sect3 id='debounce_delay'> 4039<title>debounce_delay</title> 4040 4041<para> 4042<emphasis> 4043debounce_delay</emphasis> 4044 is an attribute of the <emphasis> 4045BounceKeys</emphasis> 4046 control (see section 10.6.7). Its value specifies the <emphasis> <!-- xref --> 4047BounceKeys</emphasis> 4048 delay period in milliseconds for which the key is disabled after having been 4049pressed before another press of the same key is accepted by the server. 4050</para> 4051 4052 4053</sect3> 4054<sect3 id='mk_delay_mk_interval_mk_time_to_max_mk_max_speed_and_mk_curve'> 4055<title>mk_delay, mk_interval, mk_time_to_max, mk_max_speed, and mk_curve</title> 4056 4057<para> 4058<emphasis> 4059mk_delay</emphasis> 4060, <emphasis> 4061mk_interval</emphasis> 4062, <emphasis> 4063mk_time_to_max</emphasis> 4064, <emphasis> 4065mk_max_speed</emphasis> 4066, and <emphasis> 4067mk_curve</emphasis> 4068 are attributes of the <emphasis> 4069MouseKeysAccel</emphasis> 4070 control. Refer to section 10.5.2 for a description of these fields and the <!-- xref --> 4071units involved. 4072</para> 4073 4074 4075</sect3> 4076<sect3 id='ax_options'> 4077<title>ax_options</title> 4078 4079<para> 4080The <emphasis> 4081ax_options</emphasis> 4082 field contains attributes used to configure two different controls, the 4083<emphasis> 4084StickyKeys</emphasis> 4085 control (see section 10.6.8) and the <emphasis> <!-- xref --> 4086AccessXFeedback</emphasis> 4087 control (see section 10.6.3). The <emphasis> <!-- xref --> 4088ax_options</emphasis> 4089 field is a bitmask and may include any combination of the bits defined in 4090Table 10.9. <!-- xref --> 4091</para> 4092 4093<table frame='topbot'> 4094<title>Access X Enable/Disable Bits (ax_options field)</title> 4095<?dbfo keep-together="always" ?> 4096<tgroup cols='3' align='left' colsep='0' rowsep='0'> 4097<colspec colname='c1' colwidth='1.0*'/> 4098<colspec colname='c2' colwidth='1.3*'/> 4099<colspec colname='c3' colwidth='0.7*'/> 4100<thead> 4101<row rowsep='1'> 4102 <entry>Access X Control</entry> 4103 <entry>ax_options bit</entry> 4104 <entry>value</entry> 4105 </row> 4106</thead> 4107<tbody> 4108 <row> 4109 <entry>AccessXFeedback</entry> 4110 <entry>XkbAX_SKPressFBMask</entry> 4111 <entry>(1L<<0)</entry> 4112 </row> 4113 <row> 4114 <entry></entry> 4115 <entry>XkbAX_SKAcceptFBMask</entry> 4116 <entry>(1L << 1)</entry> 4117 </row> 4118 <row> 4119 <entry></entry> 4120 <entry>XkbAX_FeatureFBMask</entry> 4121 <entry>(1L << 2)</entry> 4122 </row> 4123 <row> 4124 <entry></entry> 4125 <entry>XkbAX_SlowWarnFBMask</entry> 4126 <entry>(1L << 3)</entry> 4127 </row> 4128 <row> 4129 <entry></entry> 4130 <entry>XkbAX_IndicatorFBMask</entry> 4131 <entry>(1L << 4)</entry> 4132 </row> 4133 <row> 4134 <entry></entry> 4135 <entry>XkbAX_StickyKeysFBMask</entry> 4136 <entry>(1L << 5)</entry> 4137 </row> 4138 <row> 4139 <entry></entry> 4140 <entry>XkbAX_SKReleaseFBMask</entry> 4141 <entry>(1L << 8)</entry> 4142 </row> 4143 <row> 4144 <entry></entry> 4145 <entry>XkbAX_SKRejectFBMask</entry> 4146 <entry>(1L << 9)</entry> 4147 </row> 4148 <row> 4149 <entry></entry> 4150 <entry>XkbAX_BKRejectFBMask</entry> 4151 <entry>(1L << 10)</entry> 4152 </row> 4153 <row> 4154 <entry></entry> 4155 <entry>XkbAX_DumbBellFBMask</entry> 4156 <entry>(1L << 11)</entry> 4157 </row> 4158 <row> 4159 <entry>StickyKeys</entry> 4160 <entry>XkbAX_TwoKeysMask</entry> 4161 <entry>(1L << 6)</entry> 4162 </row> 4163 <row> 4164 <entry></entry> 4165 <entry>XkbAX_LatchToLockMask</entry> 4166 <entry>(1L << 7)</entry> 4167 </row> 4168 <row> 4169 <entry></entry> 4170 <entry>XkbAX_AllOptionsMask</entry> 4171 <entry>(0xFFF)</entry> 4172 </row> 4173</tbody> 4174</tgroup> 4175</table> 4176 4177<para> 4178The fields pertaining to each control are relevant only when the control is 4179enabled (<emphasis> 4180XkbAccessXFeedbackMask</emphasis> 4181 or <emphasis> 4182XkbStickyKeysMask</emphasis> 4183 bit is turned on in the <emphasis> 4184enabled_cntrls</emphasis> 4185 field). 4186</para> 4187 4188 4189<para> 4190Xkb provides a set of convenience macros for working with the <emphasis> 4191ax_options</emphasis> 4192 field of an <emphasis> 4193XkbControlsRec</emphasis> 4194 structure: 4195</para> 4196 4197<para><programlisting> 4198#define <emphasis>XkbAX_NeedOption</emphasis> 4199(c,w) ((c)->ax_options&(w)) 4200</programlisting></para> 4201 4202<para> 4203The <emphasis> 4204XkbAX_NeedOption</emphasis> 4205 macro is useful for determining whether a particular AccessX option is enabled 4206or not. It accepts a pointer to an <emphasis> 4207XkbControlsRec</emphasis> 4208 structure and a valid mask bit from Table 10.9. If the specified mask bit in 4209the <emphasis> 4210ax_options</emphasis> 4211 field of the controls structure is set, the macro returns the mask bit. 4212Otherwise, it returns zero. Thus, 4213</para> 4214 4215 4216<para> 4217XkbAX_NeedOption(ctlrec, XkbAX_LatchToLockMask) 4218</para> 4219 4220 4221<para> 4222is nonzero if the latch to lock transition for latching keys is enabled, and 4223zero if it is disabled. Note that <emphasis> 4224XkbAX_NeedOption</emphasis> 4225 only determines whether or not the particular capability is configured to 4226operate; the <emphasis> 4227XkbAccessXFeedbackMask</emphasis> 4228 bit must also be turned on in <emphasis> 4229enabled_ctrls</emphasis> 4230 for the capability to actually be functioning. 4231</para> 4232 4233<para><programlisting> 4234#define <emphasis>XkbAX_AnyFeedback</emphasis> 4235(c) ((c)->enabled_ctrls&XkbAccessXFeedbackMask) 4236</programlisting></para> 4237 4238<para> 4239The <emphasis> 4240XkbAX_AnyFeeback</emphasis> 4241 macro accepts a pointer to an <emphasis> 4242XkbControlsRec</emphasis> 4243 structure and tells whether the <emphasis> 4244AccessXFeedback</emphasis> 4245 control is enabled or not. If the <emphasis> 4246AccessXFeedback</emphasis> 4247 control is enabled, the macro returns <emphasis> 4248XkbAccessXFeedbackMask</emphasis> 4249. Otherwise, it returns zero. 4250</para> 4251 4252<para><programlisting> 4253#define <emphasis>XkbAX_NeedFeedback</emphasis> 4254(c,w) (XkbAX_AnyFeedback(c)&&XkbAX_NeedOption(c,w)) 4255</programlisting></para> 4256 4257<para> 4258The <emphasis> 4259XkbAX_NeedFeedback</emphasis> 4260 macro is useful for determining if both the <emphasis> 4261AccessXFeedback</emphasis> 4262 control and a particular AccessX feedback option are enabled. The macro 4263accepts a pointer to an <emphasis> 4264XkbControlsRec</emphasis> 4265 structure and a feedback option from the table above. If both the <emphasis> 4266AccessXFeedback</emphasis> 4267 control and the specified feedback option are enabled, the macro returns 4268<emphasis> 4269True</emphasis> 4270. Otherwise it returns <emphasis> 4271False</emphasis> 4272. 4273</para> 4274 4275 4276</sect3> 4277<sect3 4278id='ax_timeout_axt_opts_mask_axt_opts_values_axt_ctrls_mask_and_axt_ctrls_values'> 4279<title>ax_timeout, axt_opts_mask, axt_opts_values, axt_ctrls_mask, and axt_ctrls_values</title> 4280 4281<para> 4282<emphasis> 4283ax_timeout</emphasis> 4284, <emphasis> 4285act_opts_mask</emphasis> 4286, <emphasis> 4287axt_opts_values</emphasis> 4288, <emphasis> 4289axt_ctrls_mask</emphasis> 4290, and <emphasis> 4291axt_ctrls_values</emphasis> 4292 are attributes of the <emphasis> 4293AccessXTimeout</emphasis> 4294 control. Refer to section 10.6.2 for a description of these fields and the <!-- xref --> 4295units involved. 4296</para> 4297 4298 4299</sect3> 4300<sect3 id='per_key_repeat'> 4301<title>per_key_repeat</title> 4302 4303<para> 4304The <emphasis> 4305per_key_repeat</emphasis> 4306 field mirrors the <emphasis> 4307auto_repeats</emphasis> 4308 field of the core protocol <emphasis> 4309XKeyboardState</emphasis> 4310 structure: changing the <emphasis> 4311auto_repeats</emphasis> 4312 field automatically changes <emphasis> 4313per_key_repeat</emphasis> 4314 and vice versa. It is provided for convenience and to reduce protocol traffic. 4315For example, to obtain the individual repeat key behavior as well as the repeat 4316delay and rate, use <emphasis> 4317XkbGetControls</emphasis> 4318. If the <emphasis> 4319per_key_repeat</emphasis> 4320 were not in this structure, you would have to call both <emphasis> 4321XGetKeyboardControl</emphasis> 4322 and <emphasis> 4323XkbGetControls</emphasis> 4324 to get this information. The bits correspond to keycodes. The first seven keys 4325(keycodes 1-7) are indicated in <emphasis> 4326per_key_repeat</emphasis> 4327[0], with bit position 0 (low order) corresponding to the fictitious keycode 0. 4328Following array elements correspond to 8 keycodes per element. A 1 bit 4329indicates that the key is a repeating key. 4330</para> 4331 4332 4333</sect3> 4334</sect2> 4335</sect1> 4336<sect1 id='Querying_Controls'> 4337<title>Querying Controls</title> 4338 4339<para> 4340Use <emphasis> 4341XkbGetControls</emphasis> 4342 to find the current state of Xkb server controls. 4343</para> 4344 4345<informaltable frame='none'> 4346<?dbfo keep-together="always" ?> 4347<tgroup cols='1' align='left' colsep='0' rowsep='0'> 4348<colspec colname='c1' colwidth='1.0*'/> 4349<tbody> 4350 <row> 4351 <entry role='functiondecl'> 4352Status <emphasis> 4353XkbGetControls</emphasis> 4354(<emphasis> 4355display, which, xkb)</emphasis> 4356 </entry> 4357 </row> 4358 <row> 4359 <entry role='functionargdecl'> 4360Display *<emphasis> 4361 display</emphasis> 4362; /* connection to X server */ 4363 </entry> 4364 </row> 4365 <row> 4366 <entry role='functionargdecl'> 4367unsigned long<emphasis> 4368 which</emphasis> 4369; /* mask of controls requested */ 4370 </entry> 4371 </row> 4372 <row> 4373 <entry role='functionargdecl'> 4374XkbDescPtr<emphasis> 4375 xkb</emphasis> 4376; /* keyboard description for controls information*/ 4377 </entry> 4378</row> 4379</tbody> 4380</tgroup> 4381</informaltable> 4382 4383<para> 4384<emphasis> 4385XkbGetControls</emphasis> 4386 queries the server for the requested control information, waits for a reply, 4387and then copies the server’s values for the requested information into the 4388<emphasis> 4389ctrls</emphasis> 4390 structure of the <emphasis> 4391xkb</emphasis> 4392 argument. Only those components specified by the <emphasis> 4393which</emphasis> 4394 parameter are copied. Valid values for <emphasis> 4395which</emphasis> 4396 are any combination of the masks listed in Table 10.7 that have "ok" in the 4397<emphasis> 4398which</emphasis> 4399 column. 4400</para> 4401 4402 4403<para> 4404If <emphasis> 4405xkb</emphasis> 4406-><emphasis> 4407ctrls </emphasis> 4408is <emphasis> 4409NULL</emphasis> 4410, <emphasis> 4411XkbGetControls</emphasis> 4412 allocates and initializes it before obtaining the values specified by 4413<emphasis> 4414which</emphasis> 4415. If <emphasis> 4416xkb</emphasis> 4417-><emphasis> 4418ctrls</emphasis> 4419 is not <emphasis> 4420NULL</emphasis> 4421, <emphasis> 4422XkbGetControls</emphasis> 4423 modifies only those portions of <emphasis> 4424xkb</emphasis> 4425-><emphasis> 4426ctrls</emphasis> 4427 corresponding to the values specified by <emphasis> 4428which</emphasis> 4429. 4430</para> 4431 4432 4433<para> 4434<emphasis> 4435XkbGetControls</emphasis> 4436 returns <emphasis> 4437Success</emphasis> 4438 if successful; otherwise, it returns <emphasis> 4439BadAlloc</emphasis> 4440 if it cannot obtain sufficient storage, <emphasis> 4441BadMatch</emphasis> 4442 if <emphasis> 4443xkb</emphasis> 4444 is <emphasis> 4445NULL</emphasis> 4446 or <emphasis> 4447which</emphasis> 4448 is empty, or <emphasis> 4449BadImplementation</emphasis> 4450. 4451</para> 4452 4453 4454<para> 4455To free the <emphasis> 4456ctrls</emphasis> 4457 member of a keyboard description, use <emphasis> 4458XkbFreeControls</emphasis> 4459 (see section 10.12) 4460</para> 4461 4462 4463<para> 4464The <emphasis> 4465num_groups</emphasis> 4466 field in the <emphasis> 4467ctrls</emphasis> 4468 structure is always filled in by <emphasis> 4469XkbGetControls</emphasis> 4470, regardless of which bits are selected by <emphasis> 4471which</emphasis> 4472. 4473</para> 4474 4475 4476</sect1> 4477<sect1 id='Changing_Controls'> 4478<title>Changing Controls</title> 4479 4480<para> 4481There are two ways to make changes to controls: either change a local copy 4482keyboard description and call <emphasis> 4483XkbSetControls</emphasis> 4484, or, to reduce network traffic, use an<emphasis> 4485 XkbControlsChangesRec</emphasis> 4486 structure and call <emphasis> 4487XkbChangeControls</emphasis> 4488. 4489</para> 4490 4491 4492<para> 4493To change the state of one or more controls, first modify the <emphasis> 4494ctrls</emphasis> 4495 structure in a local copy of the keyboard description and then use <emphasis> 4496XkbSetControls</emphasis> 4497 to copy those changes to the X server. 4498</para> 4499 4500<informaltable frame='none'> 4501<?dbfo keep-together="always" ?> 4502<tgroup cols='1' align='left' colsep='0' rowsep='0'> 4503<colspec colname='c1' colwidth='1.0*'/> 4504<tbody> 4505 <row> 4506 <entry role='functiondecl'> 4507Bool <emphasis> 4508XkbSetControls</emphasis> 4509(<emphasis> 4510display, which, xkb)</emphasis> 4511 </entry> 4512 </row> 4513 <row> 4514 <entry role='functionargdecl'> 4515Display *<emphasis> 4516 display</emphasis> 4517; /* connection to X server */ 4518 </entry> 4519 </row> 4520 <row> 4521 <entry role='functionargdecl'> 4522unsigned long <emphasis> 4523 which </emphasis> 4524; /* mask of controls to change */ 4525 </entry> 4526 </row> 4527 <row> 4528 <entry role='functionargdecl'> 4529XkbDescPtr <emphasis> 4530xkb</emphasis> 4531; /* <emphasis> 4532ctrls</emphasis> 4533 field contains new values to be set */ 4534 </entry> 4535</row> 4536</tbody> 4537</tgroup> 4538</informaltable> 4539 4540<para> 4541For each bit that is set in the <emphasis> 4542which</emphasis> 4543 parameter, <emphasis> 4544XkbSetControls</emphasis> 4545 sends the corresponding values from the <emphasis> 4546xkb</emphasis> 4547-><emphasis> 4548ctrls</emphasis> 4549 field to the server. Valid values for <emphasis> 4550which</emphasis> 4551 are any combination of the masks listed in Table 10.7 that have "ok" in the 4552<emphasis> 4553which</emphasis> 4554 column. 4555</para> 4556 4557 4558<para> 4559If <emphasis> 4560xkb</emphasis> 4561-><emphasis> 4562ctrls</emphasis> 4563 is <emphasis> 4564NULL</emphasis> 4565, the server does not support a compatible version of Xkb, or the Xkb extension 4566has not been properly initialized, <emphasis> 4567XkbSetControls</emphasis> 4568 returns <emphasis> 4569False</emphasis> 4570. Otherwise, it sends the request to the X server and returns <emphasis> 4571True</emphasis> 4572. 4573</para> 4574 4575 4576<para> 4577Note that changes to attributes of controls in the <emphasis> 4578XkbControlsRec</emphasis> 4579 structure are apparent only when the associated control is enabled, although 4580the corresponding values are still updated in the X server. For example, the 4581<emphasis> 4582repeat_delay</emphasis> 4583 and <emphasis> 4584repeat_interval</emphasis> 4585 fields are ignored unless the <emphasis> 4586RepeatKeys</emphasis> 4587 control is enabled (that is, the X server’s equivalent of <emphasis> 4588xkb->ctrls</emphasis> 4589 has <emphasis> 4590XkbRepeatKeyMask</emphasis> 4591 set in <emphasis> 4592enabled_ctrls</emphasis> 4593). It is permissible to modify the attributes of a control in one call to 4594XkbSetControls and enable the control in a subsequent call. See section 10.1.1 <!-- xref --> 4595for more information on enabling and disabling controls. 4596</para> 4597 4598 4599<para> 4600Note that the <emphasis> 4601enabled_ctrls</emphasis> 4602 field is itself a control — the <emphasis> 4603EnabledControls</emphasis> 4604 control. As such, to set a specific configuration of enabled and disabled 4605boolean controls, you must set <emphasis> 4606enabled_ctrls</emphasis> 4607 to the appropriate bits to enable only the controls you want and disable all 4608others, then specify the <emphasis> 4609XkbControlsEnabledMask</emphasis> 4610 in a call to <emphasis> 4611XkbSetControls</emphasis> 4612. Because this is somewhat awkward if all you want to do is enable and disable 4613controls, and not modify any of their attributes, a convenience function is 4614also provided for this purpose (<emphasis> 4615XkbChangeEnabledControls</emphasis> 4616, section 10.1.1). <!-- xref --> 4617</para> 4618 4619 4620<sect2 id='The_XkbControlsChangesRec_Structure'> 4621<title>The XkbControlsChangesRec Structure</title> 4622 4623<para> 4624The <emphasis> 4625XkbControlsChangesRec</emphasis> 4626 structure allows applications to track modifications to an <emphasis> 4627XkbControlsRec</emphasis> 4628 structure and thereby reduce the amount of traffic sent to the server. The 4629same <emphasis> 4630XkbControlsChangesRec</emphasis> 4631 structure may be used in several successive modifications to the same 4632<emphasis> 4633XkbControlsRec</emphasis> 4634 structure, then subsequently used to cause all of the changes, and only the 4635changes, to be propagated to the server. The <emphasis> 4636XkbControlsChangesRec</emphasis> 4637 structure is defined as follows: 4638</para> 4639 4640<para><programlisting> 4641typedef struct _XkbControlsChanges { 4642 unsigned int changed_ctrls; /* bits indicating changed control data */ 4643 unsigned int enabled_ctrls_changes; /* bits indicating enabled/disabled controls */ 4644 Bool num_groups_changed; /* <emphasis> True</emphasis> if 4645 number of keyboard groups changed */ 4646} <emphasis>XkbControlsChangesRec</emphasis>,*XkbControlsChangesPtr; 4647</programlisting></para> 4648 4649<para> 4650The <emphasis> 4651changed_ctrls</emphasis> 4652 field is a mask specifying which logical sets of data in the controls 4653structure have been modified. In this context, modified means <emphasis> 4654set</emphasis> 4655, that is, if a value is set to the same value it previously contained, it has 4656still been modified, and is noted as changed. Valid values for <emphasis> 4657changed_ctrls</emphasis> 4658 are any combination of the masks listed in Table 10.7 that have "ok" in the 4659<emphasis> 4660changed_ctrls</emphasis> 4661 column. Setting a bit implies the corresponding data fields from the "Relevant 4662XkbControlsRec Data Fields" column in Table 10.6 have been modified. The 4663<emphasis> 4664enabled_ctrls_changes</emphasis> 4665 field specifies which bits in the <emphasis> 4666enabled_ctrls</emphasis> 4667 field have changed. If the number of keyboard groups has changed, the 4668<emphasis>num_groups_changed</emphasis> 4669 field is set to <emphasis>True</emphasis>. 4670</para> 4671 4672 4673<para> 4674If you have an Xkb description with controls that have been modified and an 4675<emphasis> 4676XkbControlsChangesRec</emphasis> 4677 that describes the changes that have been made, the <emphasis> 4678XkbChangeControls</emphasis> 4679 function provides a flexible method for updating the controls in a server to 4680match those in the changed keyboard description. 4681</para> 4682 4683<informaltable frame='none'> 4684<?dbfo keep-together="always" ?> 4685<tgroup cols='1' align='left' colsep='0' rowsep='0'> 4686<colspec colname='c1' colwidth='1.0*'/> 4687<tbody> 4688 <row> 4689 <entry role='functiondecl'> 4690Bool <emphasis> 4691XkbChangeControls</emphasis> 4692(<emphasis> 4693dpy, xkb, changes</emphasis> 4694) 4695 </entry> 4696 </row> 4697 <row> 4698 <entry role='functionargdecl'> 4699Display * <emphasis> 4700dpy</emphasis> 4701; /* connection to X server */ 4702 </entry> 4703 </row> 4704 <row> 4705 <entry role='functionargdecl'> 4706XkbDescPtr <emphasis> 4707xkb</emphasis> 4708; /* keyboard description with changed <emphasis> 4709xkb->ctrls</emphasis> 4710 */ 4711 </entry> 4712 </row> 4713 <row> 4714 <entry role='functionargdecl'> 4715XkbControlsChangesPtr <emphasis> 4716changes</emphasis> 4717; /* which parts of <emphasis> 4718xkb->ctrls</emphasis> 4719 have changed */ 4720 </entry> 4721</row> 4722</tbody> 4723</tgroup> 4724</informaltable> 4725 4726<para> 4727<emphasis> 4728XkbChangeControls</emphasis> 4729 copies any controls fields specified by <emphasis> 4730changes</emphasis> 4731 from the keyboard description controls structure, <emphasis> 4732xkb</emphasis> 4733-><emphasis> 4734ctrls</emphasis> 4735, to the server specified by <emphasis> 4736dpy</emphasis> 4737. 4738</para> 4739 4740 4741</sect2> 4742</sect1> 4743<sect1 id='Tracking_Changes_to_Keyboard_Controls'> 4744<title>Tracking Changes to Keyboard Controls</title> 4745 4746<para> 4747Whenever a field in the controls structure changes in the server’s keyboard 4748description, the server sends an <emphasis> 4749XkbControlsNotify</emphasis> 4750 event to all interested clients.To receive <emphasis> 4751XkbControlsNotify</emphasis> 4752 events under all possible conditions, use <emphasis> 4753XkbSelectEvents</emphasis> 4754 (see section 4.3) and pass <emphasis> 4755XkbControlsNotifyMask</emphasis> 4756 in both <emphasis> 4757bits_to_change</emphasis> 4758 and <emphasis> 4759values_for_bits</emphasis> 4760. 4761</para> 4762 4763 4764<para> 4765To receive <emphasis> 4766XkbControlsNotify</emphasis> 4767 events only under certain conditions, use <emphasis> 4768XkbSelectEventDetails</emphasis> 4769 using <emphasis> 4770XkbControlsNotify</emphasis> 4771 as the <emphasis> 4772event_type</emphasis> 4773 and specifying the desired state changes in <emphasis> 4774bits_to_change</emphasis> 4775 and <emphasis> 4776values_for_bits</emphasis> 4777 using mask bits from Table 10.7. <!-- xref --> 4778</para> 4779 4780 4781<para> 4782The structure for the <emphasis> 4783XkbControlsNotify</emphasis> 4784 event is defined as follows: 4785</para> 4786 4787<para><programlisting> 4788typedef struct { 4789 int type; /* Xkb extension base event code */ 4790 unsigned long serial; /* X server serial number for event */ 4791 Bool send_event; /* <emphasis> True</emphasis> => synthetically generated */ 4792 Display * display; /* server connection where event generated */ 4793 Time time; /* server time when event generated */ 4794 int xkb_type; /* <emphasis> XkbCompatMapNotify</emphasis> */ 4795 int device; /* Xkb device ID, will not be <emphasis> XkbUseCoreKbd</emphasis> */ 4796 unsigned int changed_ctrls; /* bits indicating which controls data have changed*/ 4797 unsigned int enabled_ctrls; /* controls currently enabled in server */ 4798 unsigned int enabled_ctrl_changes; /* bits indicating enabled/disabled controls */ 4799 int num_groups; /* current number of keyboard groups */ 4800 KeyCode keycode; /* != 0 => keycode of key causing change */ 4801 char event_type; /* Type of event causing change */ 4802 char req_major; /* major event code of event causing change */ 4803 char req_minor; /* minor event code of event causing change */ 4804} <emphasis>XkbControlsNotifyEvent</emphasis>; 4805</programlisting></para> 4806 4807<para> 4808The <emphasis> 4809changed_ctrls</emphasis> 4810 field specifies the controls components that have changed and consists of bits 4811taken from the masks defined in Table 10.7 with "ok" in the <emphasis> 4812changed_ctrls</emphasis> 4813 column. 4814</para> 4815 4816 4817<para> 4818The controls currently enabled in the server are reported in the <emphasis> 4819enabled_ctrls</emphasis> 4820 field. If any controls were just enabled or disabled (that is, the contents of 4821the <emphasis> 4822enabled_ctrls</emphasis> 4823 field changed), they are flagged in the <emphasis> 4824enabled_ctrl_changes</emphasis> 4825 field. The valid bits for these fields are the masks listed in Table 10.7 with 4826"ok" in the <emphasis> 4827enabled_ctrls</emphasis> 4828 column. The <emphasis> 4829num_groups</emphasis> 4830 field reports the number of groups bound to the key belonging to the most 4831number of groups and is automatically updated when the keyboard mapping changes. 4832</para> 4833 4834 4835<para> 4836If the change was caused by a request from a client, the <emphasis> 4837keycode</emphasis> 4838 and <emphasis> 4839event_type</emphasis> 4840 fields are set to <emphasis> 4841zero </emphasis> 4842and the <emphasis> 4843req_major</emphasis> 4844 and <emphasis> 4845req_minor</emphasis> 4846 fields identify the request. The <emphasis> 4847req_major</emphasis> 4848 value is the same as the major extension opcode. Otherwise, <emphasis> 4849event_type</emphasis> 4850 is set to the type of event that caused the change (one of <emphasis> 4851KeyPress</emphasis> 4852, <emphasis> 4853KeyRelease</emphasis> 4854, <emphasis> 4855DeviceKeyPress</emphasis> 4856, <emphasis> 4857DeviceKeyRelease</emphasis> 4858, <emphasis> 4859ButtonPress</emphasis> 4860 or <emphasis> 4861ButtonRelease</emphasis> 4862), and <emphasis> 4863req_major</emphasis> 4864 and <emphasis> 4865req_minor</emphasis> 4866 are undefined. If <emphasis> 4867event_type</emphasis> 4868 is <emphasis> 4869KeyPress</emphasis> 4870, <emphasis> 4871KeyRelease</emphasis> 4872, <emphasis> 4873DeviceKeyPress</emphasis> 4874, or <emphasis> 4875DeviceKeyRelease</emphasis> 4876, the <emphasis> 4877keycode</emphasis> 4878 field is set to the key that caused the change. If <emphasis> 4879event_type</emphasis> 4880 is <emphasis> 4881ButtonPress</emphasis> 4882 or <emphasis> 4883ButtonRelease</emphasis> 4884, <emphasis> 4885keycode</emphasis> 4886 contains the button number. 4887</para> 4888 4889 4890<para> 4891When a client receives an <emphasis> 4892XkbControlsNotify</emphasis> 4893 event, it can note the changes in a changes structure using <emphasis> 4894XkbNoteControlsChanges</emphasis> 4895. 4896</para> 4897 4898<informaltable frame='none'> 4899<?dbfo keep-together="always" ?> 4900<tgroup cols='1' align='left' colsep='0' rowsep='0'> 4901<colspec colname='c1' colwidth='1.0*'/> 4902<tbody> 4903 <row> 4904 <entry role='functiondecl'> 4905void <emphasis> 4906XkbNoteControlsChanges</emphasis> 4907(<emphasis> 4908changes</emphasis> 4909,<emphasis> 4910 new</emphasis> 4911,<emphasis> 4912 wanted</emphasis> 4913) 4914 </entry> 4915 </row> 4916 <row> 4917 <entry role='functionargdecl'> 4918XkbControlsChangesPtr <emphasis> 4919 changes</emphasis> 4920; /* records changes indicated by new */ 4921 </entry> 4922 </row> 4923 <row> 4924 <entry role='functionargdecl'> 4925XkbControlsNotifyEvent * <emphasis> 4926 new</emphasis> 4927; /* tells which things have changed */ 4928 </entry> 4929 </row> 4930 <row> 4931 <entry role='functionargdecl'> 4932unsigned int <emphasis> 4933 wanted</emphasis> 4934; /* tells which parts of new to record in changes */ 4935 </entry> 4936</row> 4937</tbody> 4938</tgroup> 4939</informaltable> 4940 4941<para> 4942The <emphasis> 4943wanted</emphasis> 4944 parameter is a bitwise inclusive OR of bits taken from the set of masks 4945specified in Table 10.7 with "ok" in the <emphasis> 4946changed_ctrls</emphasis> 4947 column. <emphasis> 4948XkbNoteControlsChanges</emphasis> 4949 copies any changes reported in <emphasis> 4950new</emphasis> 4951 and specified in <emphasis> 4952wanted</emphasis> 4953 into the changes record specified by <emphasis> 4954old</emphasis> 4955. 4956</para> 4957 4958 4959<para> 4960Use <emphasis> 4961XkbGetControlsChanges</emphasis> 4962 to update a local copy of a keyboard description with the changes previously 4963noted by one or more calls to <emphasis> 4964XkbNoteControlsChanges.</emphasis> 4965</para> 4966 4967 4968<informaltable frame='none'> 4969<?dbfo keep-together="always" ?> 4970<tgroup cols='1' align='left' colsep='0' rowsep='0'> 4971<colspec colname='c1' colwidth='1.0*'/> 4972<tbody> 4973 <row> 4974 <entry role='functiondecl'> 4975Status <emphasis> 4976XkbGetControlsChanges</emphasis> 4977(<emphasis> 4978dpy</emphasis> 4979,<emphasis> 4980 xkb</emphasis> 4981,<emphasis> 4982 changes</emphasis> 4983) 4984 </entry> 4985 </row> 4986 <row> 4987 <entry role='functionargdecl'> 4988Display * <emphasis> 4989dpy</emphasis> 4990; /* connection to X server */ 4991 </entry> 4992 </row> 4993 <row> 4994 <entry role='functionargdecl'> 4995XkbDescPtr <emphasis> 4996xkb</emphasis> 4997; /* <emphasis> 4998xkb->ctrls</emphasis> 4999 will be updated */ 5000 </entry> 5001 </row> 5002 <row> 5003 <entry role='functionargdecl'> 5004XkbNameChangesPtr <emphasis> 5005changes</emphasis> 5006; /* indicates which parts of <emphasis> 5007xkb->ctrls</emphasis> 5008 to update */ 5009 </entry> 5010</row> 5011</tbody> 5012</tgroup> 5013</informaltable> 5014 5015<para> 5016<emphasis> 5017XkbGetControlsChanges</emphasis> 5018 examines the <emphasis> 5019changes</emphasis> 5020 parameter, queries the server for the necessary information, and copies the 5021results into the <emphasis> 5022xkb</emphasis> 5023-><emphasis> 5024ctrls</emphasis> 5025 keyboard description. If the <emphasis> 5026ctrls</emphasis> 5027 field of <emphasis> 5028xkb</emphasis> 5029 is <emphasis> 5030NULL</emphasis> 5031, <emphasis> 5032XkbGetControlsChanges</emphasis> 5033 allocates and initializes it. To free the <emphasis> 5034ctrls</emphasis> 5035 field, use <emphasis> 5036XkbFreeControls</emphasis> 5037 (see section 10.12). <!-- xref --> 5038</para> 5039 5040 5041<para> 5042<emphasis> 5043XkbGetControlsChanges</emphasis> 5044 returns <emphasis> 5045Success</emphasis> 5046 if successful and can generate <emphasis> 5047BadAlloc</emphasis> 5048, <emphasis> 5049BadImplementation,</emphasis> 5050 and <emphasis> 5051BadMatch</emphasis> 5052 errors. 5053</para> 5054 5055 5056</sect1> 5057<sect1 id='Allocating_and_Freeing_an_XkbControlsRec'> 5058<title>Allocating and Freeing an XkbControlsRec</title> 5059 5060<para> 5061The need to allocate an <emphasis> 5062XkbControlsRec</emphasis> 5063 structure seldom arises; Xkb creates one when an application calls <emphasis> 5064XkbGetControls</emphasis> 5065 or a related function. For those situations where there is not an <emphasis> 5066XkbControlsRec</emphasis> 5067 structure allocated in the <emphasis> 5068XkbDescRec</emphasis> 5069, allocate one by calling <emphasis> 5070XkbAllocControls</emphasis> 5071. 5072</para> 5073 5074<informaltable frame='none'> 5075<?dbfo keep-together="always" ?> 5076<tgroup cols='1' align='left' colsep='0' rowsep='0'> 5077<colspec colname='c1' colwidth='1.0*'/> 5078<tbody> 5079 <row> 5080 <entry role='functiondecl'> 5081Status <emphasis> 5082XkbAllocControls</emphasis> 5083(<emphasis> 5084xkb, which</emphasis> 5085) 5086 </entry> 5087 </row> 5088 <row> 5089 <entry role='functionargdecl'> 5090XkbDescPtr <emphasis> 5091 xkb</emphasis> 5092; /* Xkb description in which to allocate ctrls rec */ 5093 </entry> 5094 </row> 5095 <row> 5096 <entry role='functionargdecl'> 5097unsigned int<emphasis> 5098 which</emphasis> 5099; /* mask of components of <emphasis> 5100ctrls</emphasis> 5101 to allocate */ 5102 </entry> 5103</row> 5104</tbody> 5105</tgroup> 5106</informaltable> 5107 5108<para> 5109<emphasis> 5110XkbAllocControls</emphasis> 5111 allocates the <emphasis> 5112ctrls</emphasis> 5113 field of the <emphasis> 5114xkb</emphasis> 5115 parameter, initializes all fields to zero, and returns <emphasis> 5116Success</emphasis> 5117. If the <emphasis> 5118ctrls</emphasis> 5119 field is not <emphasis> 5120NULL</emphasis> 5121, <emphasis> 5122XkbAllocControls</emphasis> 5123 simply returns <emphasis> 5124Success</emphasis> 5125. If <emphasis> 5126xkb</emphasis> 5127 is <emphasis> 5128NULL</emphasis> 5129, <emphasis> 5130XkbAllocControls</emphasis> 5131 reports a <emphasis> 5132BadMatch</emphasis> 5133 error. If the <emphasis> 5134ctrls</emphasis> 5135 field could not be allocated, it reports a <emphasis> 5136BadAlloc</emphasis> 5137 error. 5138</para> 5139 5140 5141<para> 5142The <emphasis> 5143which</emphasis> 5144 mask specifies the individual fields of the <emphasis> 5145ctrls</emphasis> 5146 structure to be allocated and can contain any of the valid masks defined in 5147Table 10.7. Because none of the currently existing controls have any structures 5148associated with them, which is currently of little practical value in this call. 5149</para> 5150 5151 5152<para> 5153To free memory used by the <emphasis> 5154ctrls</emphasis> 5155 member of an <emphasis> 5156XkbDescRec </emphasis> 5157structure, use <emphasis> 5158XkbFreeControls:</emphasis> 5159</para> 5160 5161 5162<informaltable frame='none'> 5163<?dbfo keep-together="always" ?> 5164<tgroup cols='1' align='left' colsep='0' rowsep='0'> 5165<colspec colname='c1' colwidth='1.0*'/> 5166<tbody> 5167 <row> 5168 <entry role='functiondecl'> 5169void <emphasis> 5170XkbFreeControls</emphasis> 5171(<emphasis> 5172xkb, which, free_all</emphasis> 5173) 5174 </entry> 5175 </row> 5176 <row> 5177 <entry role='functionargdecl'> 5178XkbDescPtr<emphasis> 5179 xkb</emphasis> 5180; /* Xkb description in which to free controls components */ 5181 </entry> 5182 </row> 5183 <row> 5184 <entry role='functionargdecl'> 5185unsigned int <emphasis> 5186which</emphasis> 5187; /* mask of components of <emphasis> 5188ctrls</emphasis> 5189 to free */ 5190 </entry> 5191 </row> 5192 <row> 5193 <entry role='functionargdecl'> 5194Bool <emphasis> 5195free_all</emphasis> 5196; /* <emphasis> 5197True</emphasis> 5198 => free everything + ctrls itself */ 5199 </entry> 5200</row> 5201</tbody> 5202</tgroup> 5203</informaltable> 5204 5205<para> 5206<emphasis> 5207XkbFreeControls</emphasis> 5208 frees the specified components of the <emphasis> 5209ctrls</emphasis> 5210 field in the <emphasis> 5211xkb</emphasis> 5212 keyboard description and sets the corresponding structure component values to 5213<emphasis> 5214NULL</emphasis> 5215 or <emphasis> 5216zero</emphasis> 5217. The <emphasis> 5218which</emphasis> 5219 mask specifies the fields of <emphasis> 5220ctrls</emphasis> 5221 to be freed and can contain any of the controls components specified in Table 522210.7. 5223</para> 5224 5225 5226<para> 5227If <emphasis> 5228free_all</emphasis> 5229 is <emphasis> 5230True</emphasis> 5231, <emphasis> 5232XkbFreeControls</emphasis> 5233 frees every non-<emphasis> 5234NULL</emphasis> 5235 structure component in the controls, frees the <emphasis> 5236XkbControlsRec</emphasis> 5237 structure referenced by the <emphasis> 5238ctrls</emphasis> 5239 member of <emphasis> 5240xkb</emphasis> 5241, and sets <emphasis> 5242ctrls</emphasis> 5243 to <emphasis> 5244NULL.</emphasis> 5245</para> 5246 5247</sect1> 5248<sect1 id='The_Miscellaneous_Per_client_Controls'> 5249<title>The Miscellaneous Per-client Controls</title> 5250 5251<para> 5252You can configure the boolean per-client controls which affect the state 5253reported in button and key events. See section 12.1.1, 12.3, 12.5, and 16.3.11 <!-- xref --> 5254of the XKB Protocol specification for more details. 5255</para> 5256 5257 5258<para> 5259To get the current values of the <emphasis> 5260per-client</emphasis> 5261 controls, use <emphasis> 5262XkbGetPerClientControls</emphasis> 5263. 5264</para> 5265 5266<informaltable frame='none'> 5267<?dbfo keep-together="always" ?> 5268<tgroup cols='1' align='left' colsep='0' rowsep='0'> 5269<colspec colname='c1' colwidth='1.0*'/> 5270<tbody> 5271 <row> 5272 <entry role='functiondecl'> 5273Bool <emphasis> 5274XkbGetPerClientControls</emphasis> 5275(<emphasis> 5276dpy</emphasis> 5277, <emphasis> 5278ctrls</emphasis> 5279) 5280 </entry> 5281 </row> 5282 <row> 5283 <entry role='functionargdecl'> 5284Display * <emphasis> 5285dpy</emphasis> 5286; /* connection to X server */ 5287 </entry> 5288 </row> 5289 <row> 5290 <entry role='functionargdecl'> 5291unsigned int * <emphasis> 5292ctrls</emphasis> 5293; /* 1 bit => corresponding control is on */ 5294 </entry> 5295</row> 5296</tbody> 5297</tgroup> 5298</informaltable> 5299 5300<para> 5301<emphasis> 5302XkbGetPerClientControls</emphasis> 5303 backfills <emphasis> 5304ctrls</emphasis> 5305 with the <emphasis> 5306per-client </emphasis> 5307control attributes for this particular client. It returns <emphasis> 5308True</emphasis> 5309 if successful, and <emphasis> 5310False</emphasis> 5311 otherwise. 5312</para> 5313 5314 5315<para> 5316To change the current values of the <emphasis> 5317per-client</emphasis> 5318 control attributes, use <emphasis> 5319XkbSetPerClientControls.</emphasis> 5320</para> 5321 5322 5323<informaltable frame='none'> 5324<?dbfo keep-together="always" ?> 5325<tgroup cols='1' align='left' colsep='0' rowsep='0'> 5326<colspec colname='c1' colwidth='1.0*'/> 5327<tbody> 5328 <row> 5329 <entry role='functiondecl'> 5330Bool <emphasis> 5331XkbSetPerClientControls</emphasis> 5332(<emphasis> 5333dpy</emphasis> 5334, <emphasis> 5335ctrls</emphasis> 5336) 5337 </entry> 5338 </row> 5339 <row> 5340 <entry role='functionargdecl'> 5341Display * <emphasis> 5342dpy</emphasis> 5343; /* connection to X server */ 5344 </entry> 5345 </row> 5346 <row> 5347 <entry role='functionargdecl'> 5348unsigned int <emphasis> 5349change</emphasis> 5350; /* 1 bit => change control */ 5351 </entry> 5352 </row> 5353 <row> 5354 <entry role='functionargdecl'> 5355unsigned int * <emphasis> 5356value</emphasis> 5357; /* 1 bit => control on */ 5358 </entry> 5359</row> 5360</tbody> 5361</tgroup> 5362</informaltable> 5363 5364<para> 5365<emphasis> 5366XkbSetPerClientControls changes the per-client values for the controls selected 5367by </emphasis> 5368<emphasis> 5369change to the corresponding value in value. Legal values for change and value 5370are: XkbPCF_GrabsUseXKBStateMask, XkbPCF_LookupStateWhenGrabbed, and 5371XkbPCF_SendEventUsesXKBState. More than one control may be changed at one time 5372by OR-ing the values together. XkbSetPerClientControls backfills value with the 5373</emphasis> 5374<emphasis> 5375per-client </emphasis> 5376<emphasis> 5377control attributes for this particular client. </emphasis> 5378It returns <emphasis> 5379True</emphasis> 5380 if successful, and <emphasis> 5381False</emphasis> 5382 otherwise. 5383</para> 5384 5385</sect1> 5386</chapter> 5387