home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 August - Disc 2 / chip_20018102_hu.iso / linux / X-4.1.0 / doc / XiProtocol.TXT < prev    next >
Text File  |  2001-06-27  |  129KB  |  5,545 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.      X11 Input Extension Protocol Specification
  19.  
  20.  
  21.             Version 1.0
  22.  
  23.            X Consortium Standard
  24.  
  25.          X Version 11, Release 6.4
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.           Mark Patrick    Ardent Computer
  43.  
  44.           George Sachs    Hewlett-Packard
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85. Copyright (C) 1989, 1990, 1991 by Hewlett-Packard Company
  86. and Ardent Computer
  87.  
  88. Permission to use, copy, modify, and distribute this docu-
  89. mentation for any purpose and without fee is hereby granted,
  90. provided that the above copyright notice and this permission
  91. notice appear in all copies.  Ardent and Hewlett-Packard
  92. make no representations about the suitability for any pur-
  93. pose of the information in this document.  It is provided
  94. "as is" without express or implied warranty.
  95.  
  96.  
  97.  
  98.  
  99.  
  100. Copyright (C) 1989, 1990, 1991, 1992 X Consortium
  101.  
  102. Permission is hereby granted, free of charge, to any person
  103. obtaining a copy of this software and associated documenta-
  104. tion files (the ``Software''), to deal in the Software with-
  105. out restriction, including without limitation the rights to
  106. use, copy, modify, merge, publish, distribute, sublicense,
  107. and/or sell copies of the Software, and to permit persons to
  108. whom the Software is furnished to do so, subject to the fol-
  109. lowing conditions:
  110.  
  111. The above copyright notice and this permission notice shall
  112. be included in all copies or substantial portions of the
  113. Software.
  114.  
  115. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY
  116. KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  117. WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PUR-
  118. POSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X CONSOR-
  119. TIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  120. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  121. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
  122. OR OTHER DEALINGS IN THE SOFTWARE.
  123.  
  124. Except as contained in this notice, the name of the X Con-
  125. sortium shall not be used in advertising or otherwise to
  126. promote the sale, use or other dealings in this Software
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. without prior written authorization from the X Consortium.
  140.  
  141.  
  142.  
  143. X Window System is a trademark of X Consortium, Inc.
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. 1.1.  Input Extension Overview
  206.  
  207. This document defines an extension to the X11 protocol to
  208. support input devices other than the core X keyboard and
  209. pointer.  An accompanying document defines a corresponding
  210. extension to Xlib (similar extensions for languages other
  211. than C are anticipated).  This first section gives an
  212. overview of the input extension.  The next section defines
  213. the new protocol requests defined by the extension.  We con-
  214. clude with a description of the new input events generated
  215. by the additional input devices.
  216.  
  217. 1.2.  Design Approach
  218.  
  219. The design approach of the extension is to define requests
  220. and events analogous to the core requests and events. This
  221. allows extension input devices to be individually distin-
  222. guishable from each other and from the core input devices.
  223. These requests and events make use of a device identifier
  224. and support the reporting of n-dimensional motion data as
  225. well as other data that is not reportable via the core input
  226. events.
  227.  
  228. 1.3.  Core Input Devices
  229.  
  230. The X server core protocol supports two input devices:    a
  231. pointer and a keyboard.  The pointer device has two major
  232. functions.  First, it may be used to generate motion infor-
  233. mation that client programs can detect. Second, it may also
  234. be used to indicate the current location and focus of the X
  235. keyboard.  To accomplish this, the server echoes a cursor at
  236. the current position of the X pointer.    Unless the X key-
  237. board has been explicitly focused, this cursor also shows
  238. the current location and focus of the X keyboard.
  239.  
  240. The X keyboard is used to generate input that client pro-
  241. grams can detect.
  242.  
  243. The X keyboard and X pointer are referred to in this docu-
  244. ment as the core devices, and the input events they generate
  245. (KeyPress, KeyRelease, ButtonPress, ButtonRelease, and
  246. MotionNotify) are known as the core input events.  All other
  247. input devices are referred to as extension input devices and
  248. the input events they generate are referred to as extension
  249. input events.
  250.  
  251.                 Note
  252.  
  253.      This input extension does not change the behavior
  254.      or functionality of the core input devices, core
  255.      events, or core protocol requests, with the excep-
  256.      tion of the core grab requests.  These requests
  257.      may affect the synchronization of events from
  258.      extension devices.  See the explanation in the
  259.  
  260.  
  261.  
  262.                   1
  263.  
  264.  
  265.  
  266.  
  267.  
  268. X Input Extension Protocol Specification    X11, Release 6.4
  269.  
  270.  
  271.      section titled "Event Synchronization and Core
  272.      Grabs".
  273.  
  274.  
  275. Selection of the physical devices to be initially used by
  276. the server as the core devices is left implementation-depen-
  277. dent.  Requests are defined that allow client programs to
  278. change which physical devices are used as the core devices.
  279.  
  280. 1.4.  Extension Input Devices
  281.  
  282. The input extension controls access to input devices other
  283. than the X keyboard and X pointer.  It allows client pro-
  284. grams to select input from these devices independently from
  285. each other and independently from the core devices.
  286.  
  287. A client that wishes to access a specific device must first
  288. determine whether that device is connected to the X server.
  289. This is done through the ListInputDevices request, which
  290. will return a list of all devices that can be opened by the
  291. X server.  A client can then open one or more of these
  292. devices using the OpenDevice request, specify what events
  293. they are interested in receiving, and receive and process
  294. input events from extension devices in the same way as
  295. events from the X keyboard and X pointer.  Input events from
  296. these devices are of extension types (DeviceKeyPress,
  297. DeviceKeyRelease, DeviceButtonPress, DeviceButtonRelease,
  298. DeviceMotionNotify, etc.) and contain a device identifier so
  299. that events of the same type coming from different input
  300. devices can be distinguished.
  301.  
  302. Any kind of input device may be used as an extension input
  303. device.  Extension input devices may have 0 or more keys, 0
  304. or more buttons, and may report 0 or more axes of motion.
  305. Motion may be reported as relative movements from a previous
  306. position or as an absolute position.  All valuators report-
  307. ing motion information for a given extension input device
  308. must report the same kind of motion information (absolute or
  309. relative).
  310.  
  311. This extension is designed to accommodate new types of input
  312. devices that may be added in the future.  The protocol
  313. requests that refer to specific characteristics of input
  314. devices organize that information by input classes.  Server
  315. implementors may add new classes of input devices without
  316. changing the protocol requests.  Input classes are unique
  317. numbers registered with the X Consortium.  Each extension
  318. input device may support multiple input classes.
  319.  
  320. All extension input devices are treated like the core X key-
  321. board in determining their location and focus.    The server
  322. does not track the location of these devices on an individ-
  323. ual basis, and therefore does not echo a cursor to indicate
  324. their current location.  Instead, their location is
  325.  
  326.  
  327.  
  328.                   2
  329.  
  330.  
  331.  
  332.  
  333.  
  334. X Input Extension Protocol Specification    X11, Release 6.4
  335.  
  336.  
  337. determined by the location of the core X pointer.  Like the
  338. core X keyboard, some may be explicitly focused. If they are
  339. not explicitly focused,  their focus is determined by the
  340. location of the core X pointer.
  341.  
  342. Input events reported by the server to a client are of fixed
  343. size (32 bytes).  In order to represent the change in state
  344. of an input device the extension may need to generate a
  345. sequence of input events.  A client side library (such as
  346. Xlib) will typically take these raw input events and format
  347. them into a form more convenient to the client.
  348.  
  349. 1.4.1.    Event Classes
  350.  
  351. In the core protocol a client registers interest in receiv-
  352. ing certain input events directed to a window by modifying
  353. that window's event-mask.  Most of the bits in the event
  354. mask are already used to specify interest in core X events.
  355. The input extension specifies a different mechanism by which
  356. a client can express interest in events generated by this
  357. extension.
  358.  
  359. When a client opens a extension input device via the OpenDe-
  360. vice request, an XDevice structure is returned.  Macros are
  361. provided that extract 32-bit numbers called event classes
  362. from that structure, that a client can use to register
  363. interest in extension events via the SelectExtensionEvent
  364. request.  The event class combines the desired event type
  365. and device id, and may be thought of as the equivalent of
  366. core event masks.
  367.  
  368. 1.4.2.    Input Classes
  369.  
  370. Some of the input extension requests divide input devices
  371. into classes based on their functionality.  This is intended
  372. to allow new classes of input devices to be defined at a
  373. later time without changing the semantics of these requests.
  374. The following input device classes are currently defined:
  375.  
  376.      KEY  The device reports key events.
  377.  
  378.      BUTTON
  379.       The device reports button events.
  380.  
  381.      VALUATOR
  382.       The device reports valuator data in motion events.
  383.  
  384.      PROXIMITY
  385.       The device reports proximity events.
  386.  
  387.      FOCUS
  388.       The device can be focused and reports focus
  389.       events.
  390.  
  391.  
  392.  
  393.  
  394.                   3
  395.  
  396.  
  397.  
  398.  
  399.  
  400. X Input Extension Protocol Specification    X11, Release 6.4
  401.  
  402.  
  403.      FEEDBACK
  404.       The device supports feedbacks.
  405.  
  406.      OTHER
  407.       The ChangeDeviceNotify, DeviceMappingNotify, and
  408.       DeviceStateNotify macros may be invoked passing
  409.       the XDevice structure returned for this device.
  410.  
  411. Each extension input device may support multiple input
  412. classes.  Additional classes may be added in the future.
  413. Requests that support multiple input classes, such as the
  414. ListInputDevices function that lists all available input
  415. devices, organize the data they return by input class.
  416. Client programs that use these requests should not access
  417. data unless it matches a class defined at the time those
  418. clients were compiled.    In this way, new classes can be
  419. added without forcing existing clients that use these
  420. requests to be recompiled.
  421.  
  422. 2.  Requests
  423.  
  424. Extension input devices are accessed by client programs
  425. through the use of new protocol requests.  This section sum-
  426. marizes the new requests defined by this extension.  The
  427. syntax and type definitions used below follow the notation
  428. used for the X11 core protocol.
  429.  
  430. 2.1.  Getting the Extension Version
  431.  
  432. The GetExtensionVersion request returns version information
  433. about the input extension.
  434.  
  435. GetExtensionVersion
  436.      name: STRING
  437. =>
  438.      present: BOOL
  439.      protocol-major-version: CARD16
  440.      protocol-minor-version: CARD16
  441.  
  442.      The protocol version numbers returned indicate the ver-
  443.      sion of the input extension supported by the target X
  444.      server.  The version numbers can be compared to con-
  445.      stants defined in the header file XI.h.  Each version
  446.      is a superset of the previous versions.
  447.  
  448. 2.2.  Listing Available Devices
  449.  
  450. A client that wishes to access a specific device must first
  451. determine whether that device is connected to the X server.
  452. This is done through the ListInputDevices request, which
  453. will return a list of all devices that can be opened by the
  454. X server.
  455.  
  456. ListInputDevices
  457.  
  458.  
  459.  
  460.                   4
  461.  
  462.  
  463.  
  464.  
  465.  
  466. X Input Extension Protocol Specification    X11, Release 6.4
  467.  
  468.  
  469. =>
  470.      input-devices: LISTofDEVICEINFO
  471.  
  472. where
  473.  
  474.      DEVICEINFO:     [type: ATOM
  475.               id: CARD8
  476.               num_classes: CARD8
  477.               use: {IsXKeyboard, IsXPointer, IsExten-
  478.              sionDevice}
  479.               info: LISTofINPUTINFO
  480.               name: STRING8]
  481.  
  482.      INPUTINFO:      {KEYINFO, BUTTONINFO, VALUATORINFO}
  483.  
  484.      KEYINFO:         [class: CARD8
  485.               length: CARD8
  486.               min-keycode: KEYCODE
  487.               max-keycode: KEYCODE
  488.               num-keys: CARD16]
  489.  
  490.      BUTTONINFO:     [class: CARD8
  491.               length: CARD8
  492.               num-buttons: CARD16]
  493.  
  494.      VALUATORINFO:   [class: CARD8
  495.               length: CARD8
  496.               num_axes: CARD8
  497.               mode: SETofDEVICEMODE
  498.               motion_buffer_size: CARD32
  499.               axes: LISTofAXISINFO]
  500.  
  501.      AXISINFO:         [resolution: CARD32
  502.               min-val: CARD32
  503.               max-val: CARD32]
  504.  
  505.      DEVICEMODE:     {Absolute, Relative}
  506.  
  507.      Errors: None
  508.  
  509. This request returns a list of all devices that can be
  510. opened by the X server, including the core X keyboard and X
  511. pointer.  Some implementations may open all input devices as
  512. part of X initialization, while others may not open an input
  513. device until requested to do so by a client program.
  514.  
  515.  
  516. o  The information returned for each device is as follows:
  517.  
  518. The type field is of type Atom and indicates the nature of
  519. the device.  Clients may determine device types by invoking
  520. the XInternAtom request passing one of the names defined in
  521. the header file XI.h.  The following names have been defined
  522. to date:
  523.  
  524.  
  525.  
  526.                   5
  527.  
  528.  
  529.  
  530.  
  531.  
  532. X Input Extension Protocol Specification    X11, Release 6.4
  533.  
  534.  
  535.      MOUSE
  536.      TABLET
  537.      KEYBOARD
  538.      TOUCHSCREEN
  539.      TOUCHPAD
  540.      BUTTONBOX
  541.      BARCODE
  542.      KNOB_BOX
  543.      TRACKBALL
  544.      QUADRATURE
  545.      SPACEBALL
  546.      DATAGLOVE
  547.      EYETRACKER
  548.      CURSORKEYS
  549.      FOOTMOUSE
  550.      ID_MODULE
  551.      ONE_KNOB
  552.      NINE_KNOB
  553.  
  554.  
  555. The id is a small cardinal value in the range 0-128 that
  556. uniquely identifies the device.  It is assigned to the
  557. device when it is initialized by the server.  Some implemen-
  558. tations may not open an input device until requested by a
  559. client program, and may close the device when the last
  560. client accessing it requests that it be closed.  If a device
  561. is opened by a client program via XOpenDevice, then closed
  562. via XCloseDevice, then opened again, it is not guaranteed to
  563. have the same id after the second open request.
  564.  
  565. The num_classes field is a small cardinal value in the range
  566. 0-255 that specifies the number of input classes supported
  567. by the device for which information is returned by ListIn-
  568. putDevices.  Some input classes, such as class Focus and
  569. class Proximity do not have any information to be returned
  570. by ListInputDevices.
  571.  
  572. The use field specifies how the device is currently being
  573. used.  If the value is IsXKeyboard, the device is currently
  574. being used as the X keyboard.  If the value is IsXPointer,
  575. the device is currently being used as the X pointer.  If the
  576. value is IsXExtensionDevice, the device is available for use
  577. as an extension device.
  578.  
  579. The name field contains a pointer to a null-terminated
  580. string that corresponds to one of the defined device types.
  581.  
  582. o  InputInfo is one of: KeyInfo, ButtonInfo or ValuatorInfo.
  583.    The first two fields are common to all three:
  584.  
  585. The class field is a cardinal value in the range 0-255.  It
  586. uniquely identifies the class of input for which information
  587. is returned.
  588.  
  589.  
  590.  
  591.  
  592.                   6
  593.  
  594.  
  595.  
  596.  
  597.  
  598. X Input Extension Protocol Specification    X11, Release 6.4
  599.  
  600.  
  601. The length field is a cardinal value in the range 0-255.  It
  602. specifies the number of bytes of data that are contained in
  603. this input class.  The length includes the class and length
  604. fields.
  605.  
  606. The remaining information returned for input class KEYCLASS
  607. is as follows:
  608.  
  609. min_keycode is of type KEYCODE.  It specifies the minimum
  610. keycode that the device will report.  The minimum keycode
  611. will not be smaller than 8.
  612.  
  613. max_keycode is of type KEYCODE.  It specifies the maximum
  614. keycode that the device will report.  The maximum keycode
  615. will not be larger than 255.
  616.  
  617. num_keys is a cardinal value that specifies the number of
  618. keys that the device has.
  619.  
  620. The remaining information returned for input class BUTTON-
  621. CLASS is as follows:
  622.  
  623. num_buttons is a cardinal value that specifies the number of
  624. buttons that the device has.
  625.  
  626. The remaining information returned for input class VALUATOR-
  627. CLASS is as follows:
  628.  
  629. mode is a constant that has one of the following values:
  630. Absolute or Relative.  Some devices allow the mode to be
  631. changed dynamically via the SetDeviceMode request.
  632.  
  633. motion_buffer_size is a cardinal number that specifies the
  634. number of elements that can be contained in the motion his-
  635. tory buffer for the device.
  636.  
  637. The axes field contains a pointer to an AXISINFO struture.
  638.  
  639. o  The information returned for each axis reported by the
  640.    device is:
  641.  
  642. The resolution is a cardinal value in counts/meter.
  643.  
  644. The min_val field is a cardinal value in that contains the
  645. minimum value the device reports for this axis.  For devices
  646. whose mode is Relative, the min_val field will contain 0.
  647.  
  648. The max_val field is a cardinal value in that contains the
  649. maximum value the device reports for this axis.  For devices
  650. whose mode is Relative, the max_val field will contain 0.
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.                   7
  659.  
  660.  
  661.  
  662.  
  663.  
  664. X Input Extension Protocol Specification    X11, Release 6.4
  665.  
  666.  
  667. 2.3.  Enabling Devices
  668.  
  669. Client programs that wish to access an extension device must
  670. request that the server open that device.  This is done via
  671. the OpenDevice request.
  672.  
  673. OpenDevice
  674.      id: CARD8
  675. =>
  676.  
  677.      DEVICE:           [device_id: XID
  678.             num_classes: INT32
  679.             classes: LISTofINPUTCLASSINFO]
  680.  
  681.      INPUTCLASSINFO:   [input_class: CARD8
  682.             event_type_base: CARD8]
  683.  
  684.  
  685.      Errors: Device
  686.  
  687.  
  688. This request returns the event classes to be used by the
  689. client to indicate which events the client program wishes to
  690. receive.  Each input class may report several event classes.
  691. For example, input class Keys reports DeviceKeyPress and
  692. DeviceKeyRelease event classes.  Input classes are unique
  693. numbers registered with the X Consortium.  Input class Other
  694. exists to report event classes that are not specific to any
  695. one input class, such as DeviceMappingNotify, ChangeDevi-
  696. ceNotify, and DeviceStateNotify.
  697.  
  698.  
  699. o  The information returned for each device is as follows:
  700.  
  701. The device_id is a number that uniquely identifies the
  702. device.
  703.  
  704. The num_classes field contains the number of input classes
  705. supported by this device.
  706.  
  707.  
  708. o  For each class of input supported by the device, the
  709.    InputClassInfo structure contains the following informa-
  710.    tion:
  711.  
  712. The input_class is a small cardinal number that identifies
  713. the class of input.
  714.  
  715. The event_type_base is a small cardinal number that speci-
  716. fies the event type of one of the events reported by this
  717. input class.  This information is not directly used by
  718. client programs.  Instead, the Device is used by macros that
  719. return extension event types and event classes.  This is
  720. described in the section of this document entitled
  721.  
  722.  
  723.  
  724.                   8
  725.  
  726.  
  727.  
  728.  
  729.  
  730. X Input Extension Protocol Specification    X11, Release 6.4
  731.  
  732.  
  733. "Selecting Extension Device Events".
  734.  
  735. Before it exits, the client program should explicitly
  736. request that the server close the device.  This is done via
  737. the CloseDevice request.
  738.  
  739. A client may open the same extension device more than once.
  740. Requests after the first successful one return an additional
  741. XDevice structure with the same information as the first,
  742. but otherwise have no effect.  A single CloseDevice request
  743. will terminate that client's access to the device.
  744.  
  745. Closing a device releases any active or passive grabs the
  746. requesting client has established.  If the device is frozen
  747. only by an active grab of the requesting client, the queued
  748. events are released when the client terminates.
  749.  
  750. If a client program terminates without closing a device, the
  751. server will automatically close that device on behalf of the
  752. client.  This does not affect any other clients that may be
  753. accessing that device.
  754.  
  755.  
  756. CloseDevice
  757.      device: DEVICE
  758.  
  759.      Errors: Device
  760.  
  761.  
  762. 2.4.  Changing The Mode Of A Device
  763.  
  764. Some devices are capable of reporting either relative or
  765. absolute motion data.  To change the mode of a device from
  766. relative to absolute, use the SetDeviceMode request.  The
  767. valid values are Absolute or Relative.
  768.  
  769. This request will fail and return DeviceBusy if another
  770. client already has the device open with a different mode.
  771. It will fail and return AlreadyGrabbed if another client has
  772. the device grabbed.  The request will fail with a BadMatch
  773. error if the requested mode is not supported by the device.
  774.  
  775. SetDeviceMode
  776.      device: DEVICE
  777.      mode: {Absolute, Relative}
  778.  
  779.      Errors: Device, Match, Mode
  780.  
  781. =>
  782.      status: {Success, DeviceBusy, AlreadyGrabbed}
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.                   9
  791.  
  792.  
  793.  
  794.  
  795.  
  796. X Input Extension Protocol Specification    X11, Release 6.4
  797.  
  798.  
  799. 2.5.  Initializing Valuators on an Input Device
  800.  
  801. Some devices that report absolute positional data can be
  802. initialized to a starting value.  Devices that are capable
  803. of reporting relative motion or absolute positional data may
  804. require that their valuators be initialized to a starting
  805. value after the mode of the device is changed to Absolute.
  806. To initialize the valuators on such a device, use the SetDe-
  807. viceValuators request.
  808.  
  809. SetDeviceValuators
  810.      device: DEVICE
  811.      first_valuator: CARD8
  812.      num_valuators: CARD8
  813.      valuators: LISTOFINT32
  814.  
  815.      Errors: Length, Device, Match, Value
  816.  
  817. =>
  818.      status: {Success, AlreadyGrabbed}
  819.  
  820.  
  821. This request initializes the specified valuators on the
  822. specified extension input device.  Valuators are numbered
  823. beginning with zero.  Only the valuators in the range speci-
  824. fied by first_valuator and num_valuators are set.  If the
  825. number of valuators supported by the device is less than the
  826. expression first_valuator + num_valuators, a Value error
  827. will result.
  828.  
  829. If the request succeeds, Success is returned.  If the
  830. specifed device is grabbed by some other client, the request
  831. will fail and a status of AlreadyGrabbed will be returned.
  832.  
  833. 2.6.  Getting Input Device Controls
  834.  
  835.  
  836. GetDeviceControl
  837.      device: DEVICE
  838.      control: XID
  839.  
  840.      Errors: Length, Device, Match, Value
  841.  
  842. =>
  843.      controlState: {DeviceState}
  844.  
  845.  
  846. where
  847.  
  848.      DeviceState:   DeviceResolutionState
  849.  
  850.  
  851. Errors: Length, Device, Match, Value
  852.  
  853.  
  854.  
  855.  
  856.                  10
  857.  
  858.  
  859.  
  860.  
  861.  
  862. X Input Extension Protocol Specification    X11, Release 6.4
  863.  
  864.  
  865. This request returns the current state of the specified
  866. device control.  The device control must be supported by the
  867. target server and device or an error will result.
  868.  
  869. If the request is successful, a pointer to a generic
  870. DeviceState structure will be returned.  The information
  871. returned varies according to the specified control and is
  872. mapped by a structure appropriate for that control.
  873.  
  874. GetDeviceControl will fail with a BadValue error if the
  875. server does not support the specified control.    It will fail
  876. with a BadMatch error if the device does not support the
  877. specified control.
  878.  
  879. Supported device controls and the information returned for
  880. them include:
  881.  
  882.  
  883. DEVICE_RESOLUTION:   [control: CARD16
  884.               length: CARD16
  885.               num_valuators: CARD8
  886.               resolutions: LISTofCARD32
  887.               min_resolutions: LISTofCARD32
  888.               max_resolutions: LISTofCARD32]
  889.  
  890.  
  891. This device control returns a list of valuators and the
  892. range of valid resolutions allowed for each.  Valuators are
  893. numbered beginning with 0.  Resolutions for all valuators on
  894. the device are returned.  For each valuator i on the device,
  895. resolutions[i] returns the current setting of the resolu-
  896. tion, min_resolutions[i] returns the minimum valid setting,
  897. and max_resolutions[i] returns the maximum valid setting.
  898.  
  899. When this control is specified, XGetDeviceControl will fail
  900. with a BadMatch error if the specified device has no valua-
  901. tors.
  902.  
  903. ChangeDeviceControl
  904.      device: DEVICE
  905.      XID: controlId
  906.      control: DeviceControl
  907.  
  908.  
  909. where
  910.  
  911.      DeviceControl:   DeviceResolutionControl
  912.  
  913.  
  914. Errors: Length, Device, Match, Value
  915. =>
  916.      status: {Success, DeviceBusy, AlreadyGrabbed}
  917.  
  918.  
  919.  
  920.  
  921.  
  922.                  11
  923.  
  924.  
  925.  
  926.  
  927.  
  928. X Input Extension Protocol Specification    X11, Release 6.4
  929.  
  930.  
  931. ChangeDeviceControl changes the specifed device control
  932. according to the values specified in the DeviceControl
  933. structure.  The device control must be supported by the tar-
  934. get server and device or an error will result.
  935.  
  936. The information passed with this request varies according to
  937. the specified control and is mapped by a structure appropri-
  938. ate for that control.
  939.  
  940. ChangeDeviceControl will fail with a BadValue error if the
  941. server does not support the specified control.    It will fail
  942. with a BadMatch error if the server supports the specified
  943. control, but the requested device does not.  The request
  944. will fail and return a status of DeviceBusy if another
  945. client already has the device open with a device control
  946. state that conflicts with the one specified in the request.
  947. It will fail with a status of AlreadyGrabbed if some other
  948. client has grabbed the specified device.  If the request
  949. succeeds, Success is returned.    If it fails, the device con-
  950. trol is left unchanged.
  951.  
  952. Supported device controls and the information specified for
  953. them include:
  954.  
  955.  
  956. DEVICE_RESOLUTION:   [control: CARD16
  957.               length: CARD16
  958.               first_valuator: CARD8
  959.               num_valuators: CARD8
  960.               resolutions: LISTofCARD32]
  961.  
  962.  
  963. This device control changes the resolution of the specified
  964. valuators on the specified extension input device.  Valua-
  965. tors are numbered beginning with zero.    Only the valuators
  966. in the range specified by first_valuator and num_valuators
  967. are set.  A value of -1 in the resolutions list indicates
  968. that the resolution for this valuator is not to be changed.
  969. num_valuators specifies the number of valuators in the reso-
  970. lutions list.
  971.  
  972. When this control is specified, XChangeDeviceControl will
  973. fail with a BadMatch error if the specified device has no
  974. valuators.  If a resolution is specified that is not within
  975. the range of valid values (as returned by XGetDeviceControl)
  976. the request will fail with a BadValue error.  If the number
  977. of valuators supported by the device is less than the
  978. expression first_valuator + num_valuators, a BadValue error
  979. will result.
  980.  
  981. If the request fails for any reason, none of the valuator
  982. resolutions will be changed.
  983.  
  984.  
  985.  
  986.  
  987.  
  988.                  12
  989.  
  990.  
  991.  
  992.  
  993.  
  994. X Input Extension Protocol Specification    X11, Release 6.4
  995.  
  996.  
  997. 2.7.  Selecting Extension Device Events
  998.  
  999. Extension input events are selected using the SelectExten-
  1000. sionEvent request.
  1001.  
  1002. SelectExtensionEvent
  1003.      window: WINDOW
  1004.      interest: LISTofEVENTCLASS
  1005.  
  1006.      Errors: Window, Class, Access
  1007.  
  1008.  
  1009. This request specifies to the server the events within the
  1010. specified window which are of interest to the client.  As
  1011. with the core XSelectInput function, multiple clients can
  1012. select input on the same window.
  1013.  
  1014. XSelectExtensionEvent requires a list of event classes.  An
  1015. event class is a 32-bit number that combines an event type
  1016. and device id, and is used to indicate which event a client
  1017. wishes to receive and from which device it wishes to receive
  1018. it.  Macros are provided to obtain event classes from the
  1019. data returned by the XOpenDevice request.  The names of
  1020. these macros correspond to the desired events, i.e. the
  1021. DeviceKeyPress is used to obtain the event class for
  1022. DeviceKeyPress events.    The syntax of the macro invocation
  1023. is:
  1024.  
  1025. DeviceKeyPress (device, event_type, event_class);
  1026.      device: DEVICE
  1027.      event_type: INT
  1028.      event_class: INT
  1029.  
  1030. The value returned in event_type is the value that will be
  1031. contained in the event type field of the XDeviceKeyPressEv-
  1032. ent when it is received by the client.    The value returned
  1033. in event_class is the value that should be passed in making
  1034. an XSelectExtensionEvent request to receive DeviceKeyPress
  1035. events.
  1036.  
  1037. For DeviceButtonPress events, the client may specify whether
  1038. or not an implicit passive grab should be done when the but-
  1039. ton is pressed.  If the client wants to guarantee that it
  1040. will receive a DeviceButtonRelease event for each DeviceBut-
  1041. tonPress event it receives, it should specify the DeviceBut-
  1042. tonPressGrab event class as well as the DeviceButtonPress
  1043. event class.  This restricts the client in that only one
  1044. client at a time may request DeviceButtonPress events from
  1045. the same device and window if any client specifies this
  1046. class.
  1047.  
  1048. If any client has specified the DeviceButtonPressGrab class,
  1049. any requests by any other client that specify the same
  1050. device and window and specify DeviceButtonPress or
  1051.  
  1052.  
  1053.  
  1054.                  13
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. X Input Extension Protocol Specification    X11, Release 6.4
  1061.  
  1062.  
  1063. DeviceButtonPressGrab will cause an Access error to be gen-
  1064. erated.
  1065.  
  1066. If only the DeviceButtonPress class is specified, no
  1067. implicit passive grab will be done when a button is pressed
  1068. on the device.    Multiple clients may use this class to spec-
  1069. ify the same device and window combination.
  1070.  
  1071. A client may also specify the DeviceOwnerGrabButton class.
  1072. If it has specified both the DeviceButtonPressGrab and the
  1073. DeviceOwnerGrabButton classes, implicit passive grabs will
  1074. activate with owner_events set to True.  If only the Device-
  1075. ButtonPressGrab class is specified, implicit passive grabs
  1076. will activate with owner_events set to False.
  1077.  
  1078. The client may select DeviceMotion events only when a button
  1079. is down.  It does this by specifying the event classes But-
  1080. ton1Motion through Button5Motion, or ButtonMotion.  An input
  1081. device will only support as many button motion classes as it
  1082. has buttons.
  1083.  
  1084. 2.8.  Determining Selected Events
  1085.  
  1086. To determine which extension events are currently selected
  1087. from a given window, use GetSelectedExtensionEvents.
  1088.  
  1089. GetSelectedExtensionEvents
  1090.      window: WINDOW
  1091. =>
  1092.      this-client: LISTofEVENTCLASS
  1093.      all-clients: LISTofEVENTCLASS
  1094.  
  1095.      Errors: Window
  1096.  
  1097.  
  1098. This request returns two lists specifying the events
  1099. selected on the specified window.  One list gives the exten-
  1100. sion events selected by this client from the specified win-
  1101. dow.  The other list gives the extension events selected by
  1102. all clients from the specified window.    This information is
  1103. equivalent to that returned by your-event-mask and all-
  1104. event-masks in a GetWindowAttributes request.
  1105.  
  1106. 2.9.  Controlling Event Propagation
  1107.  
  1108. Extension events propagate up the window hierarchy in the
  1109. same manner as core events.  If a window is not interested
  1110. in an extension event, it usually propagates to the closest
  1111. ancestor that is interested, unless the dont_propagate list
  1112. prohibits it.  Grabs of extension devices may alter the set
  1113. of windows that receive a particular extension event.
  1114.  
  1115. Client programs may control extension event propagation
  1116. through the use of the following two requests.
  1117.  
  1118.  
  1119.  
  1120.                  14
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. X Input Extension Protocol Specification    X11, Release 6.4
  1127.  
  1128.  
  1129. XChangeDeviceDontPropagateList adds an event to or deletes
  1130. an event from the do_not_propagate list of extension events
  1131. for the specified window.  This list is maintained for the
  1132. life of the window, and is not altered if the client termi-
  1133. nates.
  1134.  
  1135.  
  1136. ChangeDeviceDontPropagateList
  1137.      window: WINDOW
  1138.      eventclass: LISTofEVENTCLASS
  1139.      mode: {AddToList, DeleteFromList}
  1140.  
  1141.      Errors: Window, Class, Mode
  1142.  
  1143.  
  1144. This function modifies the list specifying the events that
  1145. are not propagated to the ancestors of the specified window.
  1146. You may use the modes AddToList or DeleteFromList.
  1147.  
  1148. GetDeviceDontPropagateList
  1149.      window: WINDOW
  1150.  
  1151.      Errors: Window
  1152. =>
  1153.      dont-propagate-list: LISTofEVENTCLASS
  1154.  
  1155.  
  1156.  
  1157. This function returns a list specifying the events that are
  1158. not propagated to the ancestors of the specified window.
  1159.  
  1160. 2.10.  Sending Extension Events
  1161.  
  1162. One client program may send an event to another via the
  1163. XSendExtensionEvent function.
  1164.  
  1165. The event in the XEvent structure must be one of the events
  1166. defined by the input extension, so that the X server can
  1167. correctly byte swap the contents as necessary.    The contents
  1168. of the event are otherwise unaltered and unchecked by the X
  1169. server except to force send_event to True in the forwarded
  1170. event and to set the sequence number in the event correctly.
  1171.  
  1172. XSendExtensionEvent returns zero if the conversion-to-wire
  1173. protocol failed, otherwise it returns nonzero.
  1174.  
  1175. SendExtensionEvent
  1176.      device: DEVICE
  1177.      destination: WINDOW
  1178.      propagate: BOOL
  1179.      eventclass: LISTofEVENTCLASS
  1180.      event: XEVENT
  1181.  
  1182. Errors: Device, Value, Class, Window
  1183.  
  1184.  
  1185.  
  1186.                  15
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. X Input Extension Protocol Specification    X11, Release 6.4
  1193.  
  1194.  
  1195. 2.11.  Getting Motion History
  1196.  
  1197.  
  1198. GetDeviceMotionEvents
  1199.      device: DEVICE
  1200.      start, stop: TIMESTAMP or CurrentTime
  1201. =>
  1202.      nevents_return: CARD32
  1203.      mode_return: {Absolute, Relative}
  1204.      axis_count_return: CARD8
  1205.      events: LISTofDEVICETIMECOORD
  1206.  
  1207. where
  1208.  
  1209.      DEVICETIMECOORD:    [data:LISTofINT32  time:TIMESTAMP]
  1210.  
  1211.  
  1212.      Errors: Device, Match
  1213.  
  1214.  
  1215. This request returns all positions in the device's motion
  1216. history buffer that fall between the specified start and
  1217. stop times inclusive.  If the start time is in the future,
  1218. or is later than the stop time, no positions are returned.
  1219.  
  1220. The data field of the DEVICETIMECOORD structure is a
  1221. sequence of data items.  Each item is of type INT32, and
  1222. there is one data item per axis of motion reported by the
  1223. device.  The number of axes reported by the device is
  1224. returned in the axis_count variable.
  1225.  
  1226. The value of the data items depends on the mode of the
  1227. device, which is returned in the mode variable.  If the mode
  1228. is Absolute, the data items are the raw values generated by
  1229. the device.  These may be scaled by the client program using
  1230. the maximum values that the device can generate for each
  1231. axis of motion that it reports.  The maximum and minimum
  1232. values for each axis are reported by the ListInputDevices
  1233. request.
  1234.  
  1235. If the mode is Relative, the data items are the relative
  1236. values generated by the device.  The client program must
  1237. choose an initial position for the device and maintain a
  1238. current position by accumulating these relative values.
  1239.  
  1240. 2.12.  Changing The Core Devices
  1241.  
  1242. These requests are provided to change which physical device
  1243. is used as the X pointer or X keyboard.
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.                  16
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. X Input Extension Protocol Specification    X11, Release 6.4
  1259.  
  1260.  
  1261.                 Note
  1262.  
  1263.      Using these requests may change the characteris-
  1264.      tics of the core devices.    The new pointer device
  1265.      may have a different number of buttons than the
  1266.      old one did, or the new keyboard device may have a
  1267.      different number of keys or report a different
  1268.      range of keycodes.  Client programs may be running
  1269.      that depend on those characteristics.  For exam-
  1270.      ple, a client program could allocate an array
  1271.      based on the number of buttons on the pointer
  1272.      device, and then use the button numbers received
  1273.      in button events as indicies into that array.
  1274.      Changing the core devices could cause such client
  1275.      programs to behave improperly or abnormally termi-
  1276.      nate.
  1277.  
  1278.  
  1279. These requests change the X keyboard or X pointer device and
  1280. generate an ChangeDeviceNotify event and a MappingNotify
  1281. event.    The ChangeDeviceNotify event is sent only to those
  1282. clients that have expressed an interest in receiving that
  1283. event via the XSelectExtensionEvent request.  The specified
  1284. device becomes the new X keyboard or X pointer device.    The
  1285. location of the core device does not change as a result of
  1286. this request.
  1287.  
  1288. These requests fail and return AlreadyGrabbed if either the
  1289. specified device or the core device it would replace are
  1290. grabbed by some other client.  They fail and return
  1291. GrabFrozen if either device is frozen by the active grab of
  1292. another client.
  1293.  
  1294. These requests fail with a BadDevice error if the specified
  1295. device is invalid, or has not previously been opened via
  1296. OpenDevice.
  1297.  
  1298.  
  1299. To change the X keyboard device, use the ChangeKeyboardDe-
  1300. vice request.  The specified device must support input class
  1301. Keys (as reported in the ListInputDevices request) or the
  1302. request will fail with a BadMatch error.  Once the device
  1303. has successfully replaced one of the core devices, it is
  1304. treated as a core device until it is in turn replaced by
  1305. another ChangeDevice request, or until the server termi-
  1306. nates.    The termination of the client that changed  the
  1307. device will not cause it to change back.  Attempts to use
  1308. the CloseDevice request to close the new core device will
  1309. fail with a BadDevice error.
  1310.  
  1311. The focus state of the new keyboard is the same as the focus
  1312. state of the old X keyboard.  If the new keyboard was not
  1313. initialized with a FocusRec, one is added by the ChangeKey-
  1314. boardDevice request.  The X keyboard is assumed to have a
  1315.  
  1316.  
  1317.  
  1318.                  17
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. X Input Extension Protocol Specification    X11, Release 6.4
  1325.  
  1326.  
  1327. KbdFeedbackClassRec.  If the device was initialized without
  1328. a KbdFeedbackClassRec, one will be added by this request.
  1329. The KbdFeedbackClassRec will specify a null routine as the
  1330. control procedure and the bell procedure.
  1331.  
  1332. ChangeKeyboardDevice
  1333.      device: DEVICE
  1334.  
  1335.      Errors: Device, Match
  1336. =>
  1337.      status: Success, AlreadyGrabbed, Frozen
  1338.  
  1339.  
  1340. To change the X pointer device, use the ChangePointerDevice
  1341. request.  The specified device must support input class Val-
  1342. uators (as reported in the ListInputDevices request) or the
  1343. request will fail with a BadMatch error.  The valuators to
  1344. be used as the x- and y-axes of the pointer device must be
  1345. specified.  Data from other valuators on the device will be
  1346. ignored.
  1347.  
  1348. The X pointer device does not contain a FocusRec.  If the
  1349. new pointer was initialized with a FocusRec, it is freed by
  1350. the ChangePointerDevice request.  The X pointer is assumed
  1351. to have a ButtonClassRec and a PtrFeedbackClassRec.  If the
  1352. device was initialized without a ButtonClassRec or a Ptr-
  1353. FeedbackClassRec, one will be added by this request.  The
  1354. ButtonClassRec added will have no buttons, and the PtrFeed-
  1355. backClassRec will specify a null routine as the control pro-
  1356. cedure.
  1357.  
  1358. If the specified device reports absolute positional informa-
  1359. tion, and the server implementation does not allow such a
  1360. device to be used as the X pointer, the request will fail
  1361. with a BadDevice error.
  1362.  
  1363. Once the device has successfully replaced one of the core
  1364. devices, it is treated as a core device until it is in turn
  1365. replaced by another ChangeDevice request, or until the
  1366. server terminates.  The termination of the client that
  1367. changed  the device will not cause it to change back.
  1368. Attempts to use the CloseDevice request to close the new
  1369. core device will fail with a BadDevice error.
  1370.  
  1371. ChangePointerDevice
  1372.      device: DEVICE
  1373.      xaxis: CARD8
  1374.      yaxis: CARD8
  1375.  
  1376.      Errors: Device, Match
  1377. =>
  1378.      status: Success, AlreadyGrabbed, Frozen
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.                  18
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. X Input Extension Protocol Specification    X11, Release 6.4
  1391.  
  1392.  
  1393. 2.13.  Event Synchronization And Core Grabs
  1394.  
  1395. Implementation of the input extension requires an extension
  1396. of the meaning of event synchronization for the core grab
  1397. requests.  This is necessary in order to allow window man-
  1398. agers to freeze all input devices with a single request.
  1399.  
  1400. The core grab requests require a pointer_mode and key-
  1401. board_mode argument.  The meaning of these modes is changed
  1402. by the input extension.  For the XGrabPointer and XGrabBut-
  1403. ton requests, pointer_mode controls synchronization of the
  1404. pointer device, and keyboard_mode controls the synchroniza-
  1405. tion of all other input devices.  For the XGrabKeyboard and
  1406. XGrabKey requests, pointer_mode controls the synchronization
  1407. of all input devices except the X keyboard, while key-
  1408. board_mode controls the synchronization of the keyboard.
  1409. When using one of the core grab requests, the synchroniza-
  1410. tion of extension devices is controlled by the mode speci-
  1411. fied for the device not being grabbed.
  1412.  
  1413. 2.14.  Extension Active Grabs
  1414.  
  1415. Active grabs of extension devices are supported via the
  1416. GrabDevice request in the same way that core devices are
  1417. grabbed using the core GrabKeyboard request, except that a
  1418. Device is passed as a function parameter.  A list of events
  1419. that the client wishes to receive is also passed.  The
  1420. UngrabDevice request allows a previous active grab for an
  1421. extension device to be released.
  1422.  
  1423. To grab an extension device, use the GrabDevice request.
  1424. The device must have previously been opened using the Open-
  1425. Device request.
  1426.  
  1427. GrabDevice
  1428.      device: DEVICE
  1429.      grab-window: WINDOW
  1430.      owner-events: BOOL
  1431.      event-list: LISTofEVENTCLASS
  1432.      this-device-mode: {Synchronous, Asynchronous}
  1433.      other-device-mode: {Synchronous, Asynchronous}
  1434.      time:TIMESTAMP or CurrentTime
  1435. =>
  1436.      status: Success, AlreadyGrabbed, Frozen, InvalidTime,
  1437.      NotViewable
  1438.  
  1439.      Errors:  Device, Window, Value
  1440.  
  1441.  
  1442. This request actively grabs control of the specified input
  1443. device.  Further input events from this device are reported
  1444. only to the grabbing client.  This request overrides any
  1445. previous active grab by this client for this device.
  1446.  
  1447.  
  1448.  
  1449.  
  1450.                  19
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. X Input Extension Protocol Specification    X11, Release 6.4
  1457.  
  1458.  
  1459. The event-list parameter is a pointer to a list of event
  1460. classes.  These are used to indicate which events the client
  1461. wishes to receive while the device is grabbed.    Only event
  1462. classes obtained from the grabbed device are valid.
  1463.  
  1464. If owner-events is False, input events generated from this
  1465. device are reported with respect to grab-window, and are
  1466. only reported if selected by being included in the event-
  1467. list.  If owner-events is True, then if a generated event
  1468. would normally be reported to this client, it is reported
  1469. normally, otherwise the event is reported with respect to
  1470. the grab-window, and is only reported if selected by being
  1471. included in the event-list.  For either value of owner-
  1472. events, unreported events are discarded.
  1473.  
  1474. If this-device-mode is Asynchronous, device event processing
  1475. continues normally.  If the device is currently frozen by
  1476. this client, then processing of device events is resumed.
  1477. If this-device-mode is Synchronous, the state of the grabbed
  1478. device (as seen by means of the protocol) appears to freeze,
  1479. and no further device events are generated by the server
  1480. until the grabbing client issues a releasing AllowDe-
  1481. viceEvents request or until the device grab is released.
  1482. Actual device input events are not lost while the device is
  1483. frozen; they are simply queued for later processing.
  1484.  
  1485. If other-device-mode is Asynchronous, event processing is
  1486. unaffected by activation of the grab.  If other-device-mode
  1487. is Synchronous, the state of all input devices except the
  1488. grabbed one (as seen by means of the protocol) appears to
  1489. freeze, and no further events are generated by the server
  1490. until the grabbing client issues a releasing AllowDe-
  1491. viceEvents request or until the device grab is released.
  1492. Actual events are not lost while the devices are frozen;
  1493. they are simply queued for later processing.
  1494.  
  1495. This request generates DeviceFocusIn and DeviceFocusOut
  1496. events.
  1497.  
  1498. This request fails and returns:
  1499.  
  1500. o  AlreadyGrabbed If the device is actively grabbed by some
  1501.    other client.
  1502.  
  1503. o  NotViewable If grab-window is not viewable.
  1504.  
  1505. o  InvalidTime If the specified time is earlier than the
  1506.    last-grab-time for the specified device or later than the
  1507.    current X server time. Otherwise, the last-grab-time for
  1508.    the specified device is set to the specified time and
  1509.    CurrentTime is replaced by the current X server time.
  1510.  
  1511. o  Frozen If the device is frozen by an active grab of
  1512.    another client.
  1513.  
  1514.  
  1515.  
  1516.                  20
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522. X Input Extension Protocol Specification    X11, Release 6.4
  1523.  
  1524.  
  1525. If a grabbed device is closed by a client while an active
  1526. grab by that client is in effect, that active grab will be
  1527. released.  Any passive grabs established by that client will
  1528. be released.  If the device is frozen only by an active grab
  1529. of the requesting client, it is thawed.
  1530.  
  1531. To release a grab of an extension device, use UngrabDevice.
  1532.  
  1533. UngrabDevice
  1534.      device: DEVICE
  1535.      time: TIMESTAMP or CurrentTime
  1536.  
  1537.      Errors:  Device
  1538.  
  1539.  
  1540. This request releases the device if this client has it
  1541. actively grabbed (from either GrabDevice or GrabDeviceKey)
  1542. and releases any queued events.  If any devices were frozen
  1543. by the grab, UngrabDevice thaws them.  The request has no
  1544. effect if the specified time is earlier than the last-
  1545. device-grab time or is later than the current server time.
  1546.  
  1547. This request generates DeviceFocusIn and DeviceFocusOut
  1548. events.
  1549.  
  1550. An UngrabDevice is performed automatically if the event win-
  1551. dow for an active device grab becomes not viewable.
  1552.  
  1553. 2.15.  Passively Grabbing A Key
  1554.  
  1555. Passive grabs of buttons and keys on extension devices are
  1556. supported via the GrabDeviceButton and GrabDeviceKey
  1557. requests.  These passive grabs are released via the Ungrab-
  1558. DeviceKey and UngrabDeviceButton requests.
  1559.  
  1560. To passively grab a single key on an extension device, use
  1561. GrabDeviceKey.    That device must have previously been opened
  1562. using the OpenDevice request.
  1563.  
  1564. GrabDeviceKey
  1565.  
  1566.      device: DEVICE
  1567.      keycode: KEYCODE or AnyKey
  1568.      modifiers: SETofKEYMASK or AnyModifier
  1569.      modifier-device: DEVICE or NULL
  1570.      grab-window: WINDOW
  1571.      owner-events: BOOL
  1572.      event-list: LISTofEVENTCLASS
  1573.      this-device-mode: {Synchronous, Asynchronous}
  1574.      other-device-mode: {Synchronous, Asynchronous}
  1575.  
  1576.      Errors:  Device, Match, Access, Window, Value
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.                  21
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588. X Input Extension Protocol Specification    X11, Release 6.4
  1589.  
  1590.  
  1591. This request is analogous to the core GrabKey request.    It
  1592. establishes a passive grab on a device.  Consequently, In
  1593. the future:
  1594.  
  1595. o  IF the device is not grabbed and the specified key, which
  1596.    itself can be a modifier key, is logically pressed when
  1597.    the specified modifier keys logically are down on the
  1598.    specified modifier device (and no other keys are down),
  1599.  
  1600. o  AND no other modifier keys logically are down,
  1601.  
  1602. o  AND EITHER the grab window is an ancestor of (or is) the
  1603.    focus window OR the grab window is a descendent of the
  1604.    focus window and contains the pointer,
  1605.  
  1606. o  AND a passive grab on the same device and key combination
  1607.    does not exist on any ancestor of the grab window,
  1608.  
  1609. o  THEN the device is actively grabbed, as for GrabDevice,
  1610.    the last-device-grab time is set to the time at which the
  1611.    key was pressed (as transmitted in the DeviceKeyPress
  1612.    event), and the DeviceKeyPress event is reported.
  1613.  
  1614. The interpretation of the remaining arguments is as for
  1615. GrabDevice.  The active grab is terminated automatically
  1616. when logical state of the device has the specified key
  1617. released (independent of the logical state of the modifier
  1618. keys).
  1619.  
  1620. Note that the logical state of a device (as seen by means of
  1621. the X protocol) may lag the physical state if device event
  1622. processing is frozen.
  1623.  
  1624. A modifier of AnyModifier is equivalent to issuing the
  1625. request for all possible modifier combinations (including
  1626. the combination of no modifiers).  It is not required that
  1627. all modifiers specified have currently assigned keycodes.  A
  1628. key of AnyKey is equivalent to issuing the request for all
  1629. possible keycodes.  Otherwise, the key must be in the range
  1630. specified by min-keycode and max-keycode in the ListInputDe-
  1631. vices request.    If it is not within that range, GrabDe-
  1632. viceKey generates a Value error.
  1633.  
  1634. NULL may be passed for the modifier_device.  If the modi-
  1635. fier_device is NULL, the core X keyboard is used as the mod-
  1636. ifier_device.
  1637.  
  1638. An Access error is generated if some other client has issued
  1639. a GrabDeviceKey with the same device and key combination on
  1640. the same window.  When using AnyModifier or AnyKey, the
  1641. request fails completely and the X server generates a Access
  1642. error and no grabs are established if there is a conflicting
  1643. grab for any combination.
  1644.  
  1645.  
  1646.  
  1647.  
  1648.                  22
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. X Input Extension Protocol Specification    X11, Release 6.4
  1655.  
  1656.  
  1657. This request cannot be used to grab a key on the X keyboard
  1658. device.  The core GrabKey request should be used for that
  1659. purpose.
  1660.  
  1661. To release a passive grab of a single key on an extension
  1662. device, use UngrabDeviceKey.
  1663.  
  1664. UngrabDeviceKey
  1665.  
  1666.      device: DEVICE
  1667.      keycode: KEYCODE or AnyKey
  1668.      modifiers: SETofKEYMASK or AnyModifier
  1669.      modifier-device: DEVICE or NULL
  1670.      grab-window: WINDOW
  1671.  
  1672.      Errors:  Device, Match, Window, Value, Alloc
  1673.  
  1674.  
  1675. This request is analogous to the core UngrabKey request.  It
  1676. releases the key combination on the specified window if it
  1677. was grabbed by this client.  A modifier of AnyModifier is
  1678. equivalent to issuing the request for all possible modifier
  1679. combinations (including the combination of no modifiers).  A
  1680. key of AnyKey is equivalent to issuing the request for all
  1681. possible keycodes.  This request has no effect on an active
  1682. grab.
  1683.  
  1684. NULL may be passed for the modifier_device.  If the modi-
  1685. fier_device is NULL, the core X keyboard is used as the mod-
  1686. ifier_device.
  1687.  
  1688. 2.16.  Passively Grabbing A Button
  1689.  
  1690. To establish a passive grab for a single button on an exten-
  1691. sion device, use GrabDeviceButton.
  1692.  
  1693. GrabDeviceButton
  1694.  
  1695.      device: DEVICE
  1696.      button: BUTTON or AnyButton
  1697.      modifiers: SETofKEYMASK or AnyModifier
  1698.      modifier-device: DEVICE or NULL
  1699.      grab-window: WINDOW
  1700.      owner-events: BOOL
  1701.      event-list: LISTofEVENTCLASS
  1702.      this-device-mode: {Synchronous, Asynchronous}
  1703.      other-device-mode: {Synchronous, Asynchronous}
  1704.  
  1705.      Errors:  Device, Match, Window, Access, Value
  1706.  
  1707.  
  1708. This request is analogous to the core GrabButton request.
  1709. It establishes an explicit passive grab for a button on an
  1710. extension input device.  Since the server does not track
  1711.  
  1712.  
  1713.  
  1714.                  23
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720. X Input Extension Protocol Specification    X11, Release 6.4
  1721.  
  1722.  
  1723. extension devices, no cursor is specified with this request.
  1724. For the same reason, there is no confine-to parameter.    The
  1725. device must have previously been opened using the OpenDevice
  1726. request.
  1727.  
  1728. The GrabDeviceButton request establishes a passive grab on a
  1729. device.  Consequently, in the future,
  1730.  
  1731. o  IF the device is not grabbed and the specified button is
  1732.    logically pressed when the specified modifier keys logi-
  1733.    cally are down (and no other buttons or modifier keys are
  1734.    down),
  1735.  
  1736. o  AND the grab window contains the device,
  1737.  
  1738. o  AND a passive grab on the same device and button/ key
  1739.    combination does not exist on any ancestor of the grab
  1740.    window,
  1741.  
  1742. o  THEN the device is actively grabbed, as for GrabDevice,
  1743.    the last-grab time is set to the time at which the button
  1744.    was pressed (as transmitted in the DeviceButtonPress
  1745.    event), and the DeviceButtonPress event is reported.
  1746.  
  1747. The interpretation of the remaining arguments is as for
  1748. GrabDevice.  The active grab is terminated automatically
  1749. when logical state of the device has all buttons released
  1750. (independent of the logical state of the modifier keys).
  1751.  
  1752. Note that the logical state of a device (as seen by means of
  1753. the X protocol) may lag the physical state if device event
  1754. processing is frozen.
  1755.  
  1756. A modifier of AnyModifier is equivalent to issuing the
  1757. request for all possible modifier combinations (including
  1758. the combination of no modifiers).  It is not required that
  1759. all modifiers specified have currently assigned keycodes.  A
  1760. button of AnyButton is equivalent to issuing the request for
  1761. all possible buttons.  It is not required that the specified
  1762. button be assigned to a physical button.
  1763.  
  1764. NULL may be passed for the modifier_device.  If the modi-
  1765. fier_device is NULL, the core X keyboard is used as the mod-
  1766. ifier_device.
  1767.  
  1768. An Access error is generated if some other client has issued
  1769. a GrabDeviceButton with the same device and button combina-
  1770. tion on the same window.  When using AnyModifier or AnyBut-
  1771. ton, the request fails completely and the X server generates
  1772. a Access error and no grabs are established if there is a
  1773. conflicting grab for any combination.  The request has no
  1774. effect on an active grab.
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.                  24
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786. X Input Extension Protocol Specification    X11, Release 6.4
  1787.  
  1788.  
  1789. This request cannot be used to grab a button on the X
  1790. pointer device.  The core GrabButton request should be used
  1791. for that purpose.
  1792.  
  1793. To release a passive grab of a button on an extension
  1794. device, use UngrabDeviceButton.
  1795.  
  1796. UngrabDeviceButton
  1797.  
  1798.      device: DEVICE
  1799.      button: BUTTON or AnyButton
  1800.      modifiers: SETofKEYMASK or AnyModifier
  1801.      modifier-device: DEVICE or NULL
  1802.      grab-window: WINDOW
  1803.  
  1804.      Errors:  Device, Match, Window, Value, Alloc
  1805.  
  1806.  
  1807. This request is analogous to the core UngrabButton request.
  1808. It releases the passive button/key combination on the speci-
  1809. fied window if it was grabbed by the client.  A modifiers of
  1810. AnyModifier is equivalent to issuing the request for all
  1811. possible modifier combinations (including the combination of
  1812. no modifiers).    A button of AnyButton is equivalent to issu-
  1813. ing the request for all possible buttons.  This request has
  1814. no effect on an active grab. The device must have previously
  1815. been opened using the OpenDevice request otherwise a Device
  1816. error will be generated.
  1817.  
  1818. NULL may be passed for the modifier_device.  If the modi-
  1819. fier_device is NULL, the core X keyboard is used as the mod-
  1820. ifier_device.
  1821.  
  1822. This request cannot be used to ungrab a button on the X
  1823. pointer device.  The core UngrabButton request should be
  1824. used for that purpose.
  1825.  
  1826. 2.17.  Thawing A Device
  1827.  
  1828. To allow further events to be processed when a device has
  1829. been frozen, use AllowDeviceEvents.
  1830.  
  1831. AllowDeviceEvents
  1832.      device: DEVICE
  1833.      event-mode: {AsyncThisDevice, SyncThisDevice, Asyn-
  1834.      cOtherDevices, ReplayThisdevice, AsyncAll, or SyncAll}
  1835.      time:TIMESTAMP or CurrentTime
  1836.  
  1837.      Errors:  Device, Value
  1838.  
  1839.  
  1840. The AllowDeviceEvents request releases some queued events if
  1841. the client has caused a device to freeze.  The request has
  1842. no effect if the specified time is earlier than the last-
  1843.  
  1844.  
  1845.  
  1846.                  25
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852. X Input Extension Protocol Specification    X11, Release 6.4
  1853.  
  1854.  
  1855. grab time of the most recent active grab for the client, or
  1856. if the specified time is later than the current X server
  1857. time.
  1858.  
  1859. The following describes the processing that occurs depending
  1860. on what constant you pass to the event-mode argument:
  1861.  
  1862. o  If the specified device is frozen by the client, event
  1863.    processing for that device continues as usual.  If the
  1864.    device is frozen multiple times  by the client on behalf
  1865.    of multiple separate grabs, AsyncThisDevice thaws for
  1866.    all.  AsyncThisDevice has no effect if the specified
  1867.    device is not frozen by the client, but the device need
  1868.    not be grabbed by the client.
  1869.  
  1870. o  If the specified device is frozen and actively grabbed by
  1871.    the client, event processing for that device continues
  1872.    normally until the next button or key event is reported
  1873.    to the client.  At this time, the specified device again
  1874.    appears to freeze.  However, if the reported event causes
  1875.    the grab to be released, the specified device does not
  1876.    freeze.  SyncThisDevice has no effect if the specified
  1877.    device is not frozen by the client or is not grabbed by
  1878.    the client.
  1879.  
  1880. o  If the specified device is actively grabbed by the client
  1881.    and is frozen as the result of an event having been sent
  1882.    to the client (either from the activation of a GrabDe-
  1883.    viceButton or from a previous AllowDeviceEvents with mode
  1884.    SyncThisDevice, but not from a Grab), the grab is
  1885.    released and that event is completely reprocessed.  This
  1886.    time, however, the request ignores any passive grabs at
  1887.    or above (towards the root) the grab-window of the grab
  1888.    just released.  The request has no effect if the speci-
  1889.    fied device is not grabbed by the client or if it is not
  1890.    frozen as the result of an event.
  1891.  
  1892. o  If the remaining devices are frozen by the client, event
  1893.    processing for them continues as usual.  If the other
  1894.    devices are frozen multiple times  by the client on
  1895.    behalf of multiple separate grabs, AsyncOtherDevices
  1896.    ``thaws'' for all.  AsyncOtherDevices has no effect if
  1897.    the devices are not frozen by the client, but those
  1898.    devices need not be grabbed by the client.
  1899.  
  1900. o  If all devices are frozen by the client, event processing
  1901.    (for all devices) continues normally until the next but-
  1902.    ton or key event is reported to the client for a grabbed
  1903.    device (button event for the grabbed device, key or
  1904.    motion event for the device), at which time the devices
  1905.    again appear to freeze.  However, if the reported event
  1906.    causes the grab to be released, then the devices do not
  1907.    freeze (but if any device is still grabbed, then a subse-
  1908.    quent event for it will still cause all devices to
  1909.  
  1910.  
  1911.  
  1912.                  26
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918. X Input Extension Protocol Specification    X11, Release 6.4
  1919.  
  1920.  
  1921.    freeze).  SyncAll has no effect unless all devices are
  1922.    frozen by the client.  If any device is frozen twice by
  1923.    the client on behalf of two separate grabs, SyncAll
  1924.    "thaws" for both (but a subsequent freeze for SyncAll
  1925.    will only freeze each device once).
  1926.  
  1927. o  If all devices are frozen by the client, event processing
  1928.    (for all devices) continues normally.  If any device is
  1929.    frozen multiple times by the client on behalf of multiple
  1930.    separate grabs, AsyncAll "thaws" for all.  AsyncAll has
  1931.    no effect unless all devices are frozen by the client.
  1932.  
  1933. AsyncThisDevice, SyncThisDevice, and ReplayThisDevice have
  1934. no effect on the processing of events from the remaining
  1935. devices.  AsyncOtherDevices has no effect on the processing
  1936. of events from the specified device.  When the event_mode is
  1937. SyncAll or AsyncAll, the device parameter is ignored.
  1938.  
  1939. It is possible for several grabs of different devices (by
  1940. the same or different clients) to be active simultaneously.
  1941. If a device is frozen on behalf of any grab, no event pro-
  1942. cessing is performed for the device.  It is possible for a
  1943. single device to be frozen because of several grabs.  In
  1944. this case, the freeze must be released on behalf of each
  1945. grab before events can again be processed.
  1946.  
  1947.  
  1948. 2.18.  Controlling Device Focus
  1949.  
  1950. The current focus window for an extension input device can
  1951. be determined using the GetDeviceFocus request.  Extension
  1952. devices are focused using the SetDeviceFocus request in the
  1953. same way that the keyboard is focused using the SetInputFo-
  1954. cus request, except that a device is specified as part of
  1955. the request. One additional focus state, FollowKeyboard, is
  1956. provided for extension devices.
  1957.  
  1958. To get the current focus state, revert state, and focus time
  1959. of an extension device, use GetDeviceFocus.
  1960.  
  1961. GetDeviceFocus
  1962.  
  1963.      device: DEVICE
  1964. =>
  1965.      focus: WINDOW, PointerRoot, FollowKeyboard, or None
  1966.      revert-to: Parent, PointerRoot, FollowKeyboard, or None
  1967.      focus-time: TIMESTAMP
  1968.  
  1969.      Errors:  Device, Match
  1970.  
  1971.  
  1972. This request returns the current focus state, revert-to
  1973. state, and last-focus-time of an extension device.
  1974.  
  1975.  
  1976.  
  1977.  
  1978.                  27
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984. X Input Extension Protocol Specification    X11, Release 6.4
  1985.  
  1986.  
  1987. To set the focus of an extension device, use SetDeviceFocus.
  1988.  
  1989. SetDeviceFocus
  1990.      device: DEVICE
  1991.      focus: WINDOW, PointerRoot, FollowKeyboard, or None
  1992.      revert-to: Parent, PointerRoot, FollowKeyboard, or None
  1993.      focus-time: TIMESTAMP
  1994.  
  1995.      Errors:  Device, Window, Value, Match
  1996.  
  1997.  
  1998. This request changes the focus for an extension input device
  1999. and the last-focus-change-time.  The request has no effect
  2000. if the specified time is earlier than the last-focus-change-
  2001. time or is later than the current X server time.  Otherwise,
  2002. the last-focus-change-time is set to the specified time,
  2003. with CurrentTime replaced by the current server time.
  2004.  
  2005. The action taken by the server when this request is
  2006. requested depends on the value of the focus argument:
  2007.  
  2008. o  If the focus argument is None, all input events from this
  2009.    device will be discarded until a new focus window is set.
  2010.    In this case, the revert-to argument is ignored.
  2011.  
  2012. o  If a window ID is assigned to the focus argument, it
  2013.    becomes the focus window of the device.  If an input
  2014.    event from the device would normally be reported to this
  2015.    window or to one of its inferiors, the event is reported
  2016.    normally.  Otherwise, the event is reported relative to
  2017.    the focus window.
  2018.  
  2019. o  If you assign PointerRoot to the focus argument, the
  2020.    focus window is dynamically taken to be the root window
  2021.    of whatever screen the pointer is on at each input event.
  2022.    In this case, the revert-to argument is ignored.
  2023.  
  2024. o  If you assign FollowKeyboard to the focus argument, the
  2025.    focus window is dynamically taken to be the same as the
  2026.    focus of the X keyboard at each input event.
  2027.  
  2028. The specified focus window must be viewable at the time of
  2029. the request (else a Match error).  If the focus window later
  2030. becomes not viewable, the X server evaluates the revert-to
  2031. argument to determine the new focus window.
  2032.  
  2033. o  If you assign RevertToParent to the revert-to argument,
  2034.    the focus reverts to the parent (or the closest viewable
  2035.    ancestor), and the new revert-to value is taken to be
  2036.    RevertToNone.
  2037.  
  2038. o  If you assign RevertToPointerRoot, RevertToFollowKey-
  2039.    board, or RevertToNone to the revert-to argument, the
  2040.    focus reverts to that value.
  2041.  
  2042.  
  2043.  
  2044.                  28
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050. X Input Extension Protocol Specification    X11, Release 6.4
  2051.  
  2052.  
  2053. When the focus reverts, the X server generates DeviceFocusIn
  2054. and DeviceFocusOut events, but the last-focus-change time is
  2055. not affected.
  2056.  
  2057. This request causes the X server to generate DeviceFocusIn
  2058. and DeviceFocusOut events.
  2059.  
  2060. 2.19.  Controlling Device Feedback
  2061.  
  2062. To get the settings of feedbacks on an extension device, use
  2063. GetFeedbackControl.   This request provides functionality
  2064. equivalent to the core GetKeyboardControl and GetPointerCon-
  2065. trol functions.  It also provides a way to control displays
  2066. associated with an input device that are capable of display-
  2067. ing an integer or string.
  2068.  
  2069. GetFeedbackControl
  2070.      device: DEVICE
  2071. =>
  2072.      num_feedbacks_return: CARD16
  2073.      return_value: LISTofFEEDBACKSTATE
  2074.  
  2075.      where
  2076.  
  2077.       FEEDBACKSTATE:   {KbdFeedbackState, PtrFeedbackState,
  2078.                IntegerFeedbackState, StringFeedback-
  2079.                State, BellFeedbackState, LedFeedback-
  2080.                State}
  2081.  
  2082.  
  2083. Feedbacks are reported by class.  Those feedbacks that are
  2084. reported for the core keyboard device are in class KbdFeed-
  2085. back, and are returned in the KbdFeedbackState structure.
  2086. The members of that structure are as follows:
  2087.  
  2088.      CLASS Kbd:   [class: CARD8
  2089.            length: CARD16
  2090.            feedback id: CARD8
  2091.            key_click_percent: CARD8
  2092.            bell_percent: CARD8
  2093.            bell_pitch: CARD16
  2094.            bell_duration: CARD16
  2095.            led_value: BITMASK
  2096.            global_auto_repeat: {AutoRepeatModeOn,
  2097.           AutoRepeatModeOff}
  2098.            auto_repeats: LISTofCARD8]
  2099.  
  2100.  
  2101. Those feedbacks that are equivalent to those reported for
  2102. the core pointer are in feedback class PtrFeedback and are
  2103. reported in the PtrFeedbackState structure.  The members of
  2104. that structure are:
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.                  29
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116. X Input Extension Protocol Specification    X11, Release 6.4
  2117.  
  2118.  
  2119.      CLASS Ptr:   [class: CARD8
  2120.            length: CARD16
  2121.            feedback id: CARD8
  2122.            accelNumerator: CARD16
  2123.            accelDenominator: CARD16
  2124.            threshold: CARD16]
  2125.  
  2126.  
  2127. Some input devices provide a means of displaying an integer.
  2128. Those devices will support feedback class IntegerFeedback,
  2129. which is reported in the IntegerFeedbackState structure.
  2130. The members of that structure are:
  2131.  
  2132.  
  2133.  
  2134.      CLASS Integer:   [class: CARD8
  2135.                length: CARD16
  2136.                feedback id: CARD8
  2137.                resolution: CARD32
  2138.                min-val: INT32
  2139.                max-val: INT32]
  2140.  
  2141.  
  2142. Some input devices provide a means of displaying a string.
  2143. Those devices will support feedback class StringFeedback,
  2144. which is reported in the StringFeedbackState structure.  The
  2145. members of that structure are:
  2146.  
  2147.  
  2148.      CLASS String:   [class: CARD8
  2149.               length: CARD16
  2150.               feedback id: CARD8
  2151.               max_symbols: CARD16
  2152.               num_keysyms_supported: CARD16
  2153.               keysyms_supported: LISTofKEYSYM]
  2154.  
  2155.  
  2156. Some input devices contain a bell.  Those devices will sup-
  2157. port feedback class BellFeedback, which is reported in the
  2158. BellFeedbackState structure.  The members of that structure
  2159. are:
  2160.  
  2161.  
  2162.  
  2163.      CLASS Bell:   [class: CARD8
  2164.             length: CARD16
  2165.             feedback id: CARD8
  2166.             percent: CARD8
  2167.             pitch: CARD16
  2168.             duration: CARD16]
  2169.  
  2170.  
  2171. The percent sets the base volume for the bell between 0
  2172. (off) and 100 (loud) inclusive, if possible.  Setting to -1
  2173.  
  2174.  
  2175.  
  2176.                  30
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182. X Input Extension Protocol Specification    X11, Release 6.4
  2183.  
  2184.  
  2185. restores the default.  Other negative values generate a
  2186. Value error.
  2187.  
  2188. The pitch sets the pitch (specified in Hz) of the bell, if
  2189. possible.  Setting to -1 restores the default.    Other nega-
  2190. tive values generate a Value error.
  2191.  
  2192. The duration sets the duration (specified in milliseconds)
  2193. of the bell, if possible.  Setting to -1 restores the
  2194. default.  Other negative values generate a Value error.
  2195.  
  2196. A bell generator connected with the console but not directly
  2197. on the device is treated as if it were part of the device.
  2198. Some input devices contain LEDs.  Those devices will support
  2199. feedback class Led, which is reported in the LedFeedback-
  2200. State structure.  The members of that structure are:
  2201.  
  2202.  
  2203.  
  2204.      CLASS Led:   [class: CARD8
  2205.            length: CARD16
  2206.            feedback id: CARD8
  2207.            led_mask: BITMASK
  2208.            led_value: BITMASK]
  2209.  
  2210.  
  2211. Each bit in led_mask indicates that the corresponding led is
  2212. supported by the feedback.  At most 32 LEDs per feedback are
  2213. supported.  No standard interpretation of LEDs is defined.
  2214.  
  2215. This function will fail with a BadMatch error if the device
  2216. specified in the request does not support feedbacks.
  2217.  
  2218. Errors:  Device, Match
  2219.  
  2220. To change the settings of a feedback on an extension device,
  2221. use ChangeFeedbackControl.
  2222.  
  2223. ChangeFeedbackControl
  2224.      device: DEVICE
  2225.      feedbackid: CARD8
  2226.      value-mask: BITMASK
  2227.      value: FEEDBACKCONTROL
  2228.  
  2229.      Errors:  Device, Match, Value
  2230.  
  2231.  
  2232.  
  2233. FEEDBACKCONTROL:   {KBDFEEDBACKCONTROL, PTRFEEDBACKCONTROL,
  2234.            INTEGERFEEDBACKCONTROL, STRINGFEEDBACK-
  2235.            CONTROL, BELLFEEDBACKCONTROL, LEDFEED-
  2236.            BACKCONTROL}
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.                  31
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248. X Input Extension Protocol Specification    X11, Release 6.4
  2249.  
  2250.  
  2251. Feedback controls are grouped by class.  Those feedbacks
  2252. that are equivalent to those supported by the core keyboard
  2253. are controlled by feedback class KbdFeedbackClass using the
  2254. KbdFeedbackControl structure.  The members of that structure
  2255. are:
  2256.  
  2257.      KBDFEEDBACKCTL:   [class: CARD8
  2258.             length: CARD16
  2259.             feedback id: CARD8
  2260.             key_click_percent: INT8
  2261.             bell_percent: INT8
  2262.             bell_pitch: INT16
  2263.             bell_duration: INT16
  2264.             led_mask: INT32
  2265.             led_value: INT32
  2266.             key: KEYCODE
  2267.             auto_repeat_mode: {AutoRepeatModeOn,
  2268.              AutoRepeatModeOff, AutoRepeatModeDe-
  2269.                fault}]
  2270.  
  2271.  
  2272. The key_click_percent sets the volume for key clicks between
  2273. 0 (off) and 100 (loud) inclusive, if possible.    Setting to
  2274. -1 restores the default.  Other negative values generate a
  2275. Value error.
  2276.  
  2277. If both auto_repeat_mode and key are specified, then the
  2278. auto_repeat_mode of that key is changed, if possible.  If
  2279. only auto_repeat_mode is specified, then the global auto-
  2280. repeat mode for the entire keyboard is changed, if possible,
  2281. without affecting the per-key settings.  It is a Match error
  2282. if a key is specified without an auto_repeat_mode.
  2283.  
  2284. The order in which controls are verified and altered is
  2285. server-dependent.  If an error is generated, a subset of the
  2286. controls may have been altered.
  2287.  
  2288. Those feedback controls equivalent to those of the core
  2289. pointer are controlled by feedback class PtrFeedbackClass
  2290. using the PtrFeedbackControl structure.  The members of that
  2291. structure are as follows:
  2292.  
  2293.  
  2294.      PTRFEEDBACKCTL:   [class: CARD8
  2295.             length: CARD16
  2296.             feedback id: CARD8
  2297.             accelNumerator: INT16
  2298.             accelDenominator: INT16
  2299.             threshold: INT16]
  2300.  
  2301.  
  2302. The acceleration, expressed as a fraction, is a multiplier
  2303. for movement. For example, specifying 3/1 means the device
  2304. moves three times as fast as normal.  The fraction may be
  2305.  
  2306.  
  2307.  
  2308.                  32
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314. X Input Extension Protocol Specification    X11, Release 6.4
  2315.  
  2316.  
  2317. rounded arbitrarily by the X server.  Acceleration only
  2318. takes effect if the device moves more than threshold pixels
  2319. at once and only applies to the amount beyond the value in
  2320. the threshold argument.  Setting a value to -1 restores the
  2321. default.  The values of the do-accel and do-threshold argu-
  2322. ments must be nonzero for the device values to be set.    Oth-
  2323. erwise, the parameters will be unchanged.  Negative values
  2324. generate a Value error, as does a zero value for the accel-
  2325. denominator argument.
  2326.  
  2327. Some devices are capable of displaying an integer.  This is
  2328. done using feedback class IntegerFeedbackClass using the
  2329. IntegerFeedbackControl structure.  The members of that
  2330. structure are as follows:
  2331.  
  2332.  
  2333.      INTEGERCTL:   [class: CARD8
  2334.             length: CARD16
  2335.             feedback id: CARD8
  2336.             int_to_display: INT32]
  2337.  
  2338.  
  2339. Some devices are capable of displaying an string.  This is
  2340. done using feedback class StringFeedbackClass using the
  2341. StringFeedbackCtl structure.  The members of that structure
  2342. are as follows:
  2343.  
  2344.  
  2345.      STRINGCTL:   [class: CARD8
  2346.            length: CARD16
  2347.            feedback id: CARD8
  2348.            syms_to_display: LISTofKEYSYMS]
  2349.  
  2350.  
  2351. Some devices contain a bell.  This is done using feedback
  2352. class BellFeedbackClass using the BellFeedbackControl struc-
  2353. ture.  The members of that structure are as follows:
  2354.  
  2355.  
  2356.      BELLCTL:    [class: CARD8
  2357.          length: CARD16
  2358.          feedback id: CARD8
  2359.          percent: INT8
  2360.          pitch: INT16
  2361.          duration: INT16]
  2362.  
  2363.  
  2364. Some devices contain leds.  These can be turned on and off
  2365. using the LedFeedbackControl structure.  The members of that
  2366. structure are as follows:
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.                  33
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380. X Input Extension Protocol Specification    X11, Release 6.4
  2381.  
  2382.  
  2383.      LEDCTL:   [class: CARD8
  2384.         length: CARD16
  2385.         feedback id: CARD8
  2386.         led_mask: BITMASK
  2387.         led_value: BITMASK]
  2388.  
  2389.  
  2390. Errors:  Device, Match, Value
  2391.  
  2392.  
  2393. 2.20.  Ringing a Bell on an Input Device
  2394.  
  2395. To ring a bell on an extension input device, use DeviceBell.
  2396.  
  2397. DeviceBell
  2398.  
  2399.      device: DEVICE
  2400.      feedbackclass: CARD8
  2401.      feedbackid: CARD8
  2402.      percent: INT8
  2403.  
  2404.      Errors: Device, Value
  2405.  
  2406.  
  2407. This request is analogous to the core Bell request.  It
  2408. rings the specified bell on the specified input device feed-
  2409. back, using the specified volume.  The specified volume is
  2410. relative to the base volume for the feedback.  If the value
  2411. for the percent argument is not in the range -100 to 100
  2412. inclusive, a Value error results.  The volume at which the
  2413. bell rings when the percent argument is nonnegative is:
  2414.  
  2415.  
  2416.         base - [(base * percent) / 100] + percent
  2417.  
  2418.  
  2419. The volume at which the bell rings when the percent argument
  2420. is negative is:
  2421.  
  2422.         base + [(base * percent) / 100]
  2423.  
  2424.  
  2425. To change the base volume of the bell, use ChangeFeedback-
  2426. Control request.
  2427.  
  2428.  
  2429. 2.21.  Controlling Device Encoding
  2430.  
  2431. To get the keyboard mapping of an extension device that has
  2432. keys, use GetDeviceKeyMapping.
  2433.  
  2434. GetDeviceKeyMapping
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.                  34
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446. X Input Extension Protocol Specification    X11, Release 6.4
  2447.  
  2448.  
  2449.      device: DEVICE
  2450.      first-keycode: KEYCODE
  2451.      count: CARD8
  2452. =>
  2453.      keysyms-per-keycode: CARD8
  2454.      keysyms: LISTofKEYSYM
  2455.  
  2456.      Errors: Device, Match, Value
  2457.  
  2458.  
  2459. This request returns the symbols for the specified number of
  2460. keycodes for the specified extension device, starting with
  2461. the specified keycode.    The first-keycode must be greater
  2462. than or equal to min-keycode as returned in the connection
  2463. setup (else a Value error), and
  2464.  
  2465.  
  2466.      first-keycode + count - 1
  2467.  
  2468.  
  2469. must be less than or equal to max-keycode as returned in the
  2470. connection setup (else a Value error).    The number of ele-
  2471. ments in the keysyms list is
  2472.  
  2473.  
  2474.      count * keysyms-per-keycode
  2475.  
  2476. and KEYSYM number N (counting from zero) for keycode K has
  2477. an index (counting from zero) of
  2478.  
  2479.  
  2480.      (K - first-keycode) * keysyms-per-keycode + N
  2481.  
  2482.  
  2483. in keysyms.  The keysyms-per-keycode value is chosen arbi-
  2484. trarily by the server to be large enough to report all
  2485. requested symbols.  A special KEYSYM value of NoSymbol is
  2486. used to fill in unused elements for individual keycodes.
  2487.  
  2488. If the specified device has not first been opened by this
  2489. client via OpenDevice, or if that device does not support
  2490. input class Keys, this request will fail with a Device
  2491. error.
  2492.  
  2493. To change the keyboard mapping of an extension device that
  2494. has keys, use ChangeDeviceKeyMapping.
  2495.  
  2496. ChangeDeviceKeyMapping
  2497.      device: DEVICE
  2498.      first-keycode: KEYCODE
  2499.      keysyms-per-keycode: CARD8
  2500.      keysyms: LISTofKEYSYM
  2501.      num_codes: CARD8
  2502.  
  2503.  
  2504.  
  2505.  
  2506.                  35
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512. X Input Extension Protocol Specification    X11, Release 6.4
  2513.  
  2514.  
  2515.      Errors:  Device, Match, Value, Alloc
  2516.  
  2517.  
  2518. This request is analogous to the core ChangeKeyMapping
  2519. request.  It defines the symbols for the specified number of
  2520. keycodes for the specified extension device.  If the speci-
  2521. fied device has not first been opened by this client via
  2522. OpenDevice, or if that device does not support input class
  2523. Keys, this request will fail with a Device error.
  2524.  
  2525. The number of elements in the keysyms list must be a multi-
  2526. ple of keysyms_per_keycode.  Otherwise, ChangeDeviceKeyMap-
  2527. ping generates a Length error.    The specified first_keycode
  2528. must be greater than or equal to the min_keycode value
  2529. returned by the ListInputDevices request, or this request
  2530. will fail with a Value error.  In addition, if the following
  2531. expression is not less than the max_keycode value returned
  2532. by the ListInputDevices request, the request will fail with
  2533. a Value error:
  2534.  
  2535.  
  2536.         first_keycode + (num_codes / keysyms_per_keycode) - 1
  2537.  
  2538.  
  2539. To obtain the keycodes that are used as modifiers on an
  2540. extension device that has keys, use GetDeviceModifierMap-
  2541. ping.
  2542.  
  2543. GetDeviceModifierMapping
  2544.      device: DEVICE
  2545. =>
  2546.      keycodes-per-modifier: CARD8
  2547.      keycodes: LISTofKEYCODE
  2548.  
  2549.      Errors:  Device, Match
  2550.  
  2551.  
  2552. This request is analogous to the core GetModifierMapping
  2553. request.  This request returns the keycodes of the keys
  2554. being used as modifiers.  The number of keycodes in the list
  2555. is 8*keycodes-per-modifier.  The keycodes are divided into
  2556. eight sets, with each set containing keycodes-per-modifier
  2557. elements.  The sets are assigned in order to the modifiers
  2558. Shift, Lock, Control, Mod1, Mod2, Mod3, Mod4, and Mod5. The
  2559. keycodes-per-modifier value is chosen arbitrarily by the
  2560. server; zeroes are used to fill in unused elements within
  2561. each set.  If only zero values are given in a set, the use
  2562. of the corresponding modifier has been disabled.  The order
  2563. of keycodes within each set is chosen arbitrarily by the
  2564. server.
  2565.  
  2566. To set which keycodes that are to be used as modifiers for
  2567. an extension device, use SetDeviceModifierMapping.
  2568.  
  2569.  
  2570.  
  2571.  
  2572.                  36
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578. X Input Extension Protocol Specification    X11, Release 6.4
  2579.  
  2580.  
  2581. SetDeviceModifierMapping
  2582.  
  2583.      device: DEVICE
  2584.      keycodes-per-modifier: CARD8
  2585.      keycodes: LISTofKEYCODE
  2586. =>
  2587.      status: {Success, Busy, Failed}
  2588.  
  2589.      Errors:  Device, Match, Value, Alloc
  2590.  
  2591.  
  2592. This request is analogous to the core SetModifierMapping
  2593. request.  This request specifies the keycodes (if any) of
  2594. the keys to be used as modifiers.  The number of keycodes in
  2595. the list must be 8*keycodes-per-modifier (else a Length
  2596. error).  The keycodes are divided into eight sets, with the
  2597. sets, with each set containing keycodes-per-modifier ele-
  2598. ments.    The sets are assigned in order to the modifiers
  2599. Shift, Lock, Control, Mod1, Mod2, Mod3, Mod4, and Mod5.
  2600. Only non-zero keycode values are used within each set; zero
  2601. values are ignored.  All of the non-zero keycodes must be in
  2602. the range specified by min-keycode and max-keycode in the
  2603. ListInputDevices request (else a Value error).    The order of
  2604. keycodes within a set does not matter.    If no non-zero val-
  2605. ues are specified in a set, the use of the corresponding
  2606. modifier is disabled, and the modifier bit will always be
  2607. zero.  Otherwise, the modifier bit will be one whenever at
  2608. least one of the keys in the corresponding set is in the
  2609. down position.
  2610.  
  2611. A server can impose restrictions on how modifiers can be
  2612. changed (for example, if certain keys do not generate up
  2613. transitions in hardware or if multiple keys per modifier are
  2614. not supported).  The status reply is Failed if some such
  2615. restriction is violated, and none of the modifiers are
  2616. changed.
  2617.  
  2618. If the new non-zero keycodes specified for a modifier differ
  2619. from those currently defined, and any (current or new) keys
  2620. for that modifier are logically in the down state, then the
  2621. status reply is Busy, and none of the modifiers are changed.
  2622.  
  2623.      This request generates a DeviceMappingNotify event on a
  2624.      Success status.  The DeviceMappingNotify event will be
  2625.      sent only to those clients that have expressed an
  2626.      interest in receiving that event via the XSelectExten-
  2627.      sionEvent request.
  2628.  
  2629. A X server can impose restrictions on how modifiers can be
  2630. changed, for example, if certain keys do not generate up
  2631. transitions in hardware or if multiple modifier keys are not
  2632. supported.  If some such restriction is violated, the status
  2633. reply is MappingFailed , and none of the modifiers are
  2634. changed.  If the new keycodes specified for a modifier
  2635.  
  2636.  
  2637.  
  2638.                  37
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644. X Input Extension Protocol Specification    X11, Release 6.4
  2645.  
  2646.  
  2647. differ from those currently defined and any (current or new)
  2648. keys for that modifier are in the logically down state, the
  2649. status reply is MappingBusy, and none of the modifiers are
  2650. changed.
  2651.  
  2652. 2.22.  Controlling Button Mapping
  2653.  
  2654. These requests are analogous to the core GetPointerMapping
  2655. and ChangePointerMapping requests.  They allow a client to
  2656. determine the current mapping of buttons on an extension
  2657. device, and to change that mapping.
  2658.  
  2659. To get the current button mapping for an extension device,
  2660. use GetDeviceButtonMapping.
  2661.  
  2662. GetDeviceButtonMapping
  2663.      device: DEVICE
  2664.      nmap: CARD8
  2665. =>
  2666.      map_return: LISTofCARD8
  2667.  
  2668.      Errors:  Device, Match
  2669.  
  2670.  
  2671. The GetDeviceButtonMapping function returns the current map-
  2672. ping of the buttons on the specified device.  Elements of
  2673. the list are indexed starting from one.  The length of the
  2674. list indicates the number of physical buttons.    The nominal
  2675. mapping is the identity mapping map[i]=i.
  2676.  
  2677. nmap indicates the number of elements in the map_return
  2678. array.    Only the first nmap entries will be copied by the
  2679. library into the map_return array.
  2680.  
  2681.  
  2682.  
  2683. To set the button mapping for an extension device, use Set-
  2684. DeviceButtonMapping.
  2685.  
  2686. SetDeviceButtonMapping
  2687.      device: DEVICE
  2688.      map: LISTofCARD8
  2689.      nmap: CARD8
  2690.  
  2691. =>
  2692.      status: CARD8
  2693.  
  2694.      Errors:  Device, Match, Value
  2695.  
  2696.  
  2697. The SetDeviceButtonMapping function sets the mapping of the
  2698. specified device and causes the X server to generate a
  2699. DeviceMappingNotify event on a status of MappingSuccess.
  2700. Elements of the list are indexed starting from one.  The
  2701.  
  2702.  
  2703.  
  2704.                  38
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710. X Input Extension Protocol Specification    X11, Release 6.4
  2711.  
  2712.  
  2713. length of the list, specified in nmap, must be the same as
  2714. GetDeviceButtonMapping would return.  Otherwise, SetDevice-
  2715. ButtonMapping generates a Value error.    A zero element dis-
  2716. ables a buttons, and elements are not restricted in value by
  2717. the number of physical buttons.  However, no two elements
  2718. can have the same nonzero value.  Otherwise, this function
  2719. generates a Value error.  If any of the buttons to be
  2720. altered are in the down state, the status reply is Mapping-
  2721. Busy and the mapping is not changed.
  2722.  
  2723. 2.23.  Obtaining The State Of A Device
  2724.  
  2725. To obtain vectors that describe the state of the keys, but-
  2726. tons and valuators of an extension device, use QueryDeviceS-
  2727. tate.
  2728.  
  2729. QueryDeviceState
  2730.      device: DEVICE
  2731. =>
  2732.      device-id: CARD8
  2733.      data: LISTofINPUTCLASS
  2734.  
  2735. where
  2736.  
  2737.      INPUTCLASS:       {VALUATOR, BUTTON, KEY}
  2738.  
  2739.      CLASS VALUATOR:   [class: CARD8
  2740.             num_valuators: CARD8
  2741.                mode: CARD8
  2742.                 #x01 device mode
  2743.                  (0 = Relative, 1 = Absolute)
  2744.                 #x02 proximity state
  2745.                  (0 = InProximity, 1 = OutOf-
  2746.                  Proximity)
  2747.             valuators: LISTofINT32]
  2748.  
  2749.      CLASS BUTTON:     [class: CARD8
  2750.             num_buttons: CARD8
  2751.             buttons: LISTofCARD8]
  2752.  
  2753.      CLASS KEY:        [class: CARD8
  2754.             num_keys: CARD8
  2755.             keys: LISTofCARD8]
  2756.  
  2757.  
  2758.      Errors:  Device
  2759.  
  2760.  
  2761. The QueryDeviceState request returns the current logical
  2762. state of the buttons, keys, and valuators on the specified
  2763. input device.  The buttons and keys arrays, byte N (from 0)
  2764. contains the bits for key or button 8N to 8N+7 with the
  2765. least significant bit in the byte representing key or button
  2766. 8N.
  2767.  
  2768.  
  2769.  
  2770.                  39
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776. X Input Extension Protocol Specification    X11, Release 6.4
  2777.  
  2778.  
  2779. If the device has valuators, a bit in the mode field indi-
  2780. cates whether the device is reporting Absolute or Relative
  2781. data.  If it is reporting Absolute data, the valuators array
  2782. will contain the current value of the valuators.  If it is
  2783. reporting Relative data, the valuators array will contain
  2784. undefined data.
  2785.  
  2786. If the device reports proximity information, a bit in the
  2787. mode field indicates whether the device is InProximity or
  2788. OutOfProximity.
  2789.  
  2790. 3.  Events
  2791.  
  2792. The input extension creates input events analogous to the
  2793. core input events.  These extension input events are gener-
  2794. ated by manipulating one of the extension input devices.
  2795.  
  2796. 3.1.  Button, Key, and Motion Events
  2797.  
  2798. DeviceKeyPress
  2799. DeviceKeyRelease
  2800. DeviceButtonPress,
  2801. DeviceButtonRelease
  2802. DeviceMotionNotify
  2803.  
  2804.      device: CARD8
  2805.      root, event: WINDOW
  2806.      child: Window or None
  2807.      same-screen: BOOL
  2808.      root-x, root-y, event-x, event-y: INT16
  2809.      detail: <see below>
  2810.      state: SETofKEYBUTMASK
  2811.      time: TIMESTAMP
  2812.  
  2813.  
  2814. These events are generated when a key, button, or valuator
  2815. logically changes state.  The generation of these logical
  2816. changes may lag the physical changes, if device event pro-
  2817. cessing is frozen.  Note that DeviceKeyPress and
  2818. DeviceKeyRelease are generated for all keys, even those
  2819. mapped to modifier bits.  The ``source'' of the event is the
  2820. window the pointer is in.  The window with respect to which
  2821. the event is normally reported is found by looking up the
  2822. hierarchy (starting with the source window) for the first
  2823. window on which any client has selected interest in the
  2824. event.    The actual window used for reporting can be modified
  2825. by active grabs and by the focus window.The window the event
  2826. is reported with respect to is called the ``event'' window.
  2827.  
  2828. The root is the root window of the ``source'' window, and
  2829. root-x and root-y are the pointer coordinates relative to
  2830. root's origin at the time of the event.  Event is the
  2831. ``event'' window.  If the event window is on the same screen
  2832. as root, then event-x and event-y are the pointer
  2833.  
  2834.  
  2835.  
  2836.                  40
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842. X Input Extension Protocol Specification    X11, Release 6.4
  2843.  
  2844.  
  2845. coordinates relative to the event window's origin.  Other-
  2846. wise, event-x and event-y are zero.  If the source window is
  2847. an inferior of the event window, then child is set to the
  2848. child of the event window that is an ancestor of (or is) the
  2849. source window.    Otherwise, it is set to None. The state com-
  2850. ponent gives the logical state of the buttons on the core X
  2851. pointer and modifier keys on the core X keyboard just before
  2852. the event.  The detail component type varies with the event
  2853. type:
  2854.  
  2855. +--------------------+-------------------+
  2856. |Event             | Component     |
  2857. +--------------------+-------------------+
  2858. |DeviceKeyPress,     | KEYCODE         |
  2859. |DeviceKeyRelease    |             |
  2860. +--------------------+-------------------+
  2861. |DeviceButtonPress,  | BUTTON         |
  2862. |DeviceButtonRelease |             |
  2863. +--------------------+-------------------+
  2864. |DeviceMotionNotify  | { Normal , Hint } |
  2865. +--------------------+-------------------+
  2866.  
  2867. The granularity of motion events is not guaranteed, but a
  2868. client selecting for motion events is guaranteed to get at
  2869. least one event when a valuator changes. If DeviceMotionHint
  2870. is selected, the server is free to send only one DeviceMo-
  2871. tionNotify event (with detail Hint) to the client for the
  2872. event window, until either a key or button changes state,
  2873. the pointer leaves the event window, or the client issues a
  2874. QueryDeviceState or GetDeviceMotionEvents request.
  2875.  
  2876. 3.2.  DeviceValuator Event
  2877.  
  2878. DeviceValuator
  2879.  
  2880.      device: CARD8
  2881.      device_state: SETofKEYBUTMASK
  2882.      num_valuators: CARD8
  2883.      first_valuator: CARD8
  2884.      valuators: LISTofINT32
  2885.  
  2886.  
  2887. DeviceValuator events are generated to contain valuator
  2888. information for which there is insufficient space in
  2889. DeviceKey, DeviceButton, DeviceMotion, and Proximity wire
  2890. events.  For events of these types, a second event of type
  2891. DeviceValuator follows immediately.  The library combines
  2892. these events into a single event that a client can receive
  2893. via XNextEvent.  DeviceValuator events are not selected for
  2894. by clients, they only exist to contain information that will
  2895. not fit into some event selected by clients.
  2896.  
  2897. The device_state component gives the state of the buttons
  2898. and modifiers on the device generating the event.
  2899.  
  2900.  
  2901.  
  2902.                  41
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908. X Input Extension Protocol Specification    X11, Release 6.4
  2909.  
  2910.  
  2911. Extension motion devices may report motion data for a vari-
  2912. able number of axes.  The valuators array contains the val-
  2913. ues of all axes reported by the device.  If more than 6 axes
  2914. are reported, more than one DeviceValuator event will be
  2915. sent by the server, and more than one DeviceKey, DeviceBut-
  2916. ton, DeviceMotion, or Proximity event will be reported by
  2917. the library.  Clients should examine the corresponding
  2918. fields of the event reported by the library to determine the
  2919. total number of axes reported, and the first axis reported
  2920. in the current event.  Axes are numbered beginning with
  2921. zero.
  2922.  
  2923. For Button, Key and Motion events on a device reporting
  2924. absolute motion data the current value of the device's valu-
  2925. ators is reported.  For devices that report relative data,
  2926. Button and Key events may be followed by a DeviceValuator
  2927. event that contains 0s in the num_valuators field.   In this
  2928. case, only the device_state component will have meaning.
  2929.  
  2930. 3.3.  Device Focus Events
  2931.  
  2932. DeviceFocusIn
  2933. DeviceFocusOut
  2934.  
  2935.      device: CARD8
  2936.      time: TIMESTAMP
  2937.      event: WINDOW
  2938.      mode: { Normal, WhileGrabbed, Grab, Ungrab}
  2939.      detail: { Ancestor, Virtual, Inferior, Nonlinear, Non-
  2940.      linearVirtual, Pointer, PointerRoot, None}
  2941.  
  2942. These events are generated when the input focus changes and
  2943. are reported to clients selecting DeviceFocusChange for the
  2944. specified device and window.  Events generated by SetDevice-
  2945. Focus when the device is not grabbed have mode Normal.
  2946. Events generated by SetDeviceFocus when the device is
  2947. grabbed have mode WhileGrabbed.  Events generated when a
  2948. device grab actives have mode Grab, and events generated
  2949. when a device grab deactivates have mode Ungrab.
  2950.  
  2951. All DeviceFocusOut events caused by a window unmap are gen-
  2952. erated after any UnmapNotify event, but the ordering of
  2953. DeviceFocusOut with respect to generated EnterNotify,
  2954. LeaveNotify, VisibilityNotify and Expose events is not con-
  2955. strained.
  2956.  
  2957. DeviceFocusIn and DeviceFocusOut events are generated for
  2958. focus changes of extension devices in the same manner as
  2959. focus events for the core devices are generated.
  2960.  
  2961. 3.4.  Device State Notify Event
  2962.  
  2963. DeviceStateNotify
  2964.  
  2965.  
  2966.  
  2967.  
  2968.                  42
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974. X Input Extension Protocol Specification    X11, Release 6.4
  2975.  
  2976.  
  2977.      time: TIMESTAMP
  2978.      device: CARD8
  2979.      num_keys: CARD8
  2980.      num_buttons: CARD8
  2981.      num_valuators: CARD8
  2982.      classes_reported: CARD8 {SetOfDeviceMode | SetOfInput-
  2983.      Class}
  2984.       SetOfDeviceMode:
  2985.            #x80 ProximityState
  2986.             0 = InProxmity, 1 = OutOfProximity
  2987.            #x40 Device Mode
  2988.             (0 = Relative, 1 = Absolute)
  2989.       SetOfInputClass:
  2990.            #x04 reporting valuators
  2991.            #x02 reporting buttons
  2992.            #x01 reporting keys
  2993.      buttons: LISTofCARD8
  2994.      keys: LISTofCARD8
  2995.      valuators: LISTofCARD32
  2996.  
  2997.  
  2998. This event reports the state of the device just as in the
  2999. QueryDeviceState request.  This event is reported to clients
  3000. selecting DeviceStateNotify for the device and window and is
  3001. generated immediately after every EnterNotify and DeviceFo-
  3002. cusIn.    If the device has no more than 32 buttons, no more
  3003. than 32 keys, and no more than 3 valuators, This event can
  3004. report the state of the device.  If the device has more than
  3005. 32 buttons, the event will be immediately followed by a
  3006. DeviceButtonStateNotify event.    If the device has more than
  3007. 32 keys, the event will be followed by a DeviceKeyStateNo-
  3008. tify event.  If the device has more than 3 valuators, the
  3009. event will be followed by one or more DeviceValuator events.
  3010.  
  3011. 3.5.  Device KeyState and ButtonState Notify Events
  3012.  
  3013. DeviceKeyStateNotify
  3014.  
  3015.      device: CARD8
  3016.      keys: LISTofCARD8
  3017.  
  3018. DeviceButtonStateNotify
  3019.  
  3020.      device: CARD8
  3021.      buttons: LISTofCARD8
  3022.  
  3023. These events contain information about the state of keys and
  3024. buttons on a device that will not fit into the DeviceS-
  3025. tateNotify wire event.    These events are not selected by
  3026. clients, rather they may immediately follow a DeviceStateNo-
  3027. tify wire event and be combined with it into a single
  3028. DeviceStateNotify client event that a client may receive via
  3029. XNextEvent.
  3030.  
  3031.  
  3032.  
  3033.  
  3034.                  43
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040. X Input Extension Protocol Specification    X11, Release 6.4
  3041.  
  3042.  
  3043. 3.6.  DeviceMappingNotify Event
  3044.  
  3045. DeviceMappingNotify
  3046.  
  3047.      time: TIMESTAMP
  3048.      device: CARD8
  3049.      request: CARD8
  3050.      first_keycode: CARD8
  3051.      count: CARD8
  3052.  
  3053. This event reports a change in the mapping of keys, modi-
  3054. fiers, or buttons on an extension device.  This event is
  3055. reported to clients selecting DeviceMappingNotify for the
  3056. device and window and is generated after every client SetDe-
  3057. viceButtonMapping, ChangeDeviceKeyMapping, or  ChangeDevice-
  3058. ModifierMapping request.
  3059.  
  3060. 3.7.  ChangeDeviceNotify Event
  3061.  
  3062. ChangeDeviceNotify
  3063.  
  3064.      device: CARD8
  3065.      time: TIMESTAMP
  3066.      request: CARD8
  3067.  
  3068. This event reports a change in the physical device being
  3069. used as the core X keyboard or X pointer device.  ChangeDe-
  3070. viceNotify events are reported to clients selecting
  3071. ChangeDeviceNotify for the device and window and is gener-
  3072. ated after every client ChangeKeyboardDevice or  ChangePoin-
  3073. terDevice request.
  3074.  
  3075. 3.8.  Proximity Events
  3076.  
  3077. ProximityIn
  3078. ProximityOut
  3079.  
  3080.      device: CARD8
  3081.      root, event: WINDOW
  3082.      child: Window or None
  3083.      same-screen: BOOL
  3084.      root-x, root-y, event-x, event-y: INT16
  3085.      state: SETofKEYBUTMASK
  3086.      time: TIMESTAMP
  3087.      device-state: SETofKEYBUTMASK
  3088.      axis-count: CARD8
  3089.      first-axis: CARD8
  3090.      axis-data: LISTofINT32
  3091.  
  3092.  
  3093. These events are generated by some devices (such as graphics
  3094. tablets or touchscreens) to indicate that a stylus has moved
  3095. into or out of contact with a positional sensing surface.
  3096.  
  3097.  
  3098.  
  3099.  
  3100.                  44
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106. X Input Extension Protocol Specification    X11, Release 6.4
  3107.  
  3108.  
  3109. The ``source'' of the event is the window the pointer is in.
  3110. The window with respect to which the event is normally
  3111. reported is found by looking up the hierarchy (starting with
  3112. the source window) for the first window on which any client
  3113. has selected interest in the event.  The actual window used
  3114. for reporting can be modified by active grabs and by the
  3115. focus window.The window the event is reported with respect
  3116. to is called the ``event'' window.
  3117.  
  3118. The root is the root window of the ``source'' window, and
  3119. root-x and root-y are the pointer coordinates relative to
  3120. root's origin at the time of the event.  Event is the
  3121. ``event'' window.  If the event window is on the same screen
  3122. as root, then event-x and event-y are the pointer coordi-
  3123. nates relative to the event window's origin.  Otherwise,
  3124. event-x and event-y are zero.  If the source window is an
  3125. inferior of the event window, then child is set to the child
  3126. of the event window that is an ancestor of (or is) the
  3127. source window.    Otherwise, it is set to None. The state com-
  3128. ponent gives the logical state of the buttons on the core X
  3129. pointer and modifier keys on the core X keyboard just before
  3130. the event.  The device-state component gives the state of
  3131. the buttons and modifiers on the device generating the
  3132. event.
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.                  45
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172. X Input Extension Protocol Specification    X11, Release 6.4
  3173.  
  3174.  
  3175.  
  3176.  
  3177.              Appendix A
  3178.  
  3179.          Input Extension Protocol Encoding
  3180.  
  3181.  
  3182.  
  3183. Syntactic Conventions
  3184.  
  3185. All numbers are in decimal, unless prefixed with #x, in
  3186. which case they are in hexadecimal (base 16).
  3187.  
  3188. The general syntax used to describe requests, replies,
  3189. errors, events, and compound types is:
  3190.  
  3191.  
  3192.      NameofThing
  3193.        encode-form
  3194.        ...
  3195.        encode-form
  3196.  
  3197. Each encode-form describes a single component.
  3198.  
  3199. For components described in the protocol as:
  3200.  
  3201.  
  3202.      name: TYPE
  3203.  
  3204. the encode-form is:
  3205.  
  3206.  
  3207.      N           TYPE name
  3208.  
  3209. N is the number of bytes occupied in the data stream, and
  3210. TYPE is the interpretation of those bytes.  For example,
  3211.  
  3212.  
  3213.      depth: CARD8
  3214.  
  3215. becomes:
  3216.  
  3217.  
  3218.      1           CARD8          depth
  3219.  
  3220. For components with a static numeric value the encode-form
  3221. is:
  3222.  
  3223.  
  3224.      N           value          name
  3225.  
  3226. The value is always interpreted as an N-byte unsigned inte-
  3227. ger.  For example, the first two bytes of a Window error are
  3228. always zero (indicating an error in general) and three
  3229.  
  3230.  
  3231.  
  3232.                  46
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238. X Input Extension Protocol Specification    X11, Release 6.4
  3239.  
  3240.  
  3241. (indicating the Window error in particular):
  3242.  
  3243.  
  3244.      1           0    Error
  3245.      1           3    code
  3246.  
  3247. For components described in the protocol as:
  3248.  
  3249.  
  3250.      name: {Name1, ..., NameI}
  3251.  
  3252.  
  3253. the encode-form is:
  3254.  
  3255.  
  3256.      N            name
  3257.            value1 Name1
  3258.            ...
  3259.            valueI NameI
  3260.  
  3261. The value is always interpreted as an N-byte unsigned inte-
  3262. ger.  Note that the size of N is sometimes larger than that
  3263. strictly required to encode the values.  For example:
  3264.  
  3265.  
  3266.      class: {InputOutput, InputOnly, CopyFromParent}
  3267.  
  3268.  
  3269. becomes:
  3270.  
  3271.  
  3272.      2                  class
  3273.            0    CopyFromParent
  3274.            1    InputOutput
  3275.            2    InputOnly
  3276.  
  3277. For components described in the protocol as:
  3278.  
  3279.  
  3280.      NAME: TYPE or Alternative1 ... or AlternativeI
  3281.  
  3282.  
  3283. the encode-form is:
  3284.  
  3285.  
  3286.      N           TYPE          NAME
  3287.            value1     Alternative1
  3288.            ...
  3289.            valueI     AlternativeI
  3290.  
  3291. The alternative values are guaranteed not to conflict with
  3292. the encoding of TYPE.  For example:
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.                  47
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304. X Input Extension Protocol Specification    X11, Release 6.4
  3305.  
  3306.  
  3307.      destination: WINDOW or PointerWindow or InputFocus
  3308.  
  3309.  
  3310. becomes:
  3311.  
  3312.  
  3313.      4           WINDOW          destination
  3314.            0    PointerWindow
  3315.            1    InputFocus
  3316.  
  3317. For components described in the protocol as:
  3318.  
  3319.  
  3320.      value-mask: BITMASK
  3321.  
  3322. the encode-form is:
  3323.  
  3324.  
  3325.      N           BITMASK          value-mask
  3326.            mask1     mask-name1
  3327.            ...
  3328.            maskI     mask-nameI
  3329.  
  3330. The individual bits in the mask are specified and named, and
  3331. N is 2 or 4.  The most-significant bit in a BITMASK is
  3332. reserved for use in defining chained (multiword) bitmasks,
  3333. as extensions augment existing core requests.  The precise
  3334. interpretation of this bit is not yet defined here, although
  3335. a probable mechanism is that a 1-bit indicates that another
  3336. N bytes of bitmask follows, with bits within the overall
  3337. mask still interpreted from least-significant to most-sig-
  3338. nificant with an N-byte unit, with N-byte units interpreted
  3339. in stream order, and with the overall mask being byte-
  3340. swapped in individual N-byte units.
  3341.  
  3342. For LISTofVALUE encodings, the request is followed by a sec-
  3343. tion of the form:
  3344.  
  3345.  
  3346.      VALUEs
  3347.       encode-form
  3348.       ...
  3349.       encode-form
  3350.  
  3351. listing an encode-form for each VALUE.    The NAME in each
  3352. encode-form keys to the corresponding BITMASK bit.  The
  3353. encoding of a VALUE always occupies four bytes, but the num-
  3354. ber of bytes specified in the encoding-form indicates how
  3355. many of the least-significant bytes are actually used; the
  3356. remaining bytes are unused and their values do not matter.
  3357.  
  3358. In various cases, the number of bytes occupied by a compo-
  3359. nent will be specified by a lowercase single-letter variable
  3360. name instead of a specific numeric value, and often some
  3361.  
  3362.  
  3363.  
  3364.                  48
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370. X Input Extension Protocol Specification    X11, Release 6.4
  3371.  
  3372.  
  3373. other component will have its value specified as a simple
  3374. numeric expression involving these variables.  Components
  3375. specified with such expressions are always interpreted as
  3376. unsigned integers.  The scope of such variables is always
  3377. just the enclosing request, reply, error, event, or compound
  3378. type structure.  For example:
  3379.  
  3380.  
  3381.      2           3+n          request length
  3382.      4n        LISTofPOINT    points
  3383.  
  3384. For unused bytes (the values of the bytes are undefined and
  3385. do not matter), the encode-form is:
  3386.  
  3387.  
  3388.      N             unused
  3389.  
  3390. If the number of unused bytes is variable, the encode-form
  3391. typically is:
  3392.  
  3393.  
  3394.      p             unused, p=pad(E)
  3395.  
  3396. where E is some expression, and pad(E) is the number of
  3397. bytes needed to round E up to a multiple of four.
  3398.  
  3399.  
  3400.      pad(E) = (4 - (E mod 4)) mod 4
  3401.  
  3402. Common Types
  3403.  
  3404. LISTofFOO
  3405.  
  3406.      In this document the LISTof notation strictly means
  3407.      some number of repetitions of the FOO encoding; the
  3408.      actual length of the list is encoded elsewhere.
  3409.  
  3410. SETofFOO
  3411.  
  3412.      A set is always represented by a bitmask, with a 1-bit
  3413.      indicating presence in the set.
  3414.  
  3415. BITMASK: CARD32
  3416.  
  3417. WINDOW: CARD32
  3418.  
  3419. BYTE: 8-bit value
  3420.  
  3421. INT8: 8-bit signed integer
  3422.  
  3423. INT16: 16-bit signed integer
  3424.  
  3425. INT32: 32-bit signed integer
  3426.  
  3427.  
  3428.  
  3429.  
  3430.                  49
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436. X Input Extension Protocol Specification    X11, Release 6.4
  3437.  
  3438.  
  3439. CARD8: 8-bit unsigned integer
  3440.  
  3441. CARD16: 16-bit unsigned integer
  3442.  
  3443. CARD32: 32-bit unsigned integer
  3444.  
  3445. TIMESTAMP: CARD32
  3446.  
  3447. EVENTCLASS: CARD32
  3448.  
  3449.  
  3450. INPUTCLASS
  3451.        0     KeyClass
  3452.        1     ButtonClass
  3453.        2     ValuatorClass
  3454.        3     FeedbackClass
  3455.        4     ProximityClass
  3456.        5     FocusClass
  3457.        6     OtherClass
  3458.  
  3459.  
  3460.  
  3461. INPUTCLASS
  3462.        0     KbdFeedbackClass
  3463.        1     PtrFeedbackClass
  3464.        2     StringFeedbackClass
  3465.        3     IntegerFeedbackClass
  3466.        4     LedFeedbackClass
  3467.        5     BellFeedbackClass
  3468.  
  3469.  
  3470.  
  3471. INPUTINFO
  3472.        0     KEYINFO
  3473.        1     BUTTONINFO
  3474.        2     VALUATORINFO
  3475.  
  3476.  
  3477.  
  3478. DEVICEMODE
  3479.        0     Relative
  3480.        1     Absolute
  3481.  
  3482.  
  3483.  
  3484. PROXIMITYSTATE
  3485.        0     InProximity
  3486.        1     OutOfProximity
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.                  50
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502. X Input Extension Protocol Specification    X11, Release 6.4
  3503.  
  3504.  
  3505. BOOL
  3506.        0     False
  3507.        1     True
  3508.  
  3509.  
  3510. KEYSYM: CARD32
  3511.  
  3512. KEYCODE: CARD8
  3513.  
  3514. BUTTON: CARD8
  3515.  
  3516.  
  3517. SETofKEYBUTMASK
  3518.        #x0001     Shift
  3519.        #x0002     Lock
  3520.        #x0004     Control
  3521.        #x0008     Mod1
  3522.        #x0010     Mod2
  3523.        #x0020     Mod3
  3524.        #x0040     Mod4
  3525.        #x0080     Mod5
  3526.        #x0100     Button1
  3527.        #x0200     Button2
  3528.        #x0400     Button3
  3529.        #x0800     Button4
  3530.        #x1000     Button5
  3531.        #xe000     unused but must be zero
  3532.  
  3533.  
  3534.  
  3535. SETofKEYMASK
  3536.        encodings are the same as for SETofKEYBUTMASK, except with
  3537.        #xff00     unused but must be zero
  3538.  
  3539.  
  3540. STRING8: LISTofCARD8
  3541.  
  3542.  
  3543. STR
  3544.   1  n             length of name in bytes
  3545.   n  STRING8         name
  3546.  
  3547. Errors
  3548.  
  3549.  
  3550. Request
  3551.   1  0             Error
  3552.   1  1             code
  3553.   2  CARD16         sequence number
  3554.   4             unused
  3555.   2  CARD16         minor opcode
  3556.   1  CARD8         major opcode
  3557.   21             unused
  3558.  
  3559.  
  3560.  
  3561.  
  3562.                  51
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568. X Input Extension Protocol Specification    X11, Release 6.4
  3569.  
  3570.  
  3571. Value
  3572.   1  0             Error
  3573.   1  2             code
  3574.   2  CARD16         sequence number
  3575.   4  <32-bits>         bad value
  3576.   2  CARD16         minor opcode
  3577.   1  CARD8         major opcode
  3578.   21             unused
  3579.  
  3580.  
  3581.  
  3582. Window
  3583.   1  0             Error
  3584.   1  3             code
  3585.   2  CARD16         sequence number
  3586.   4  CARD32         bad resource id
  3587.   2  CARD16         minor opcode
  3588.   1  CARD8         major opcode
  3589.   21             unused
  3590.  
  3591.  
  3592.  
  3593. Match
  3594.   1  0             Error
  3595.   1  8             code
  3596.   2  CARD16         sequence number
  3597.   4             unused
  3598.   2  CARD16         minor opcode
  3599.   1  CARD8         major opcode
  3600.   21             unused
  3601.  
  3602.  
  3603.  
  3604. Access
  3605.   1  0             Error
  3606.   1  10          code
  3607.   2  CARD16         sequence number
  3608.   4             unused
  3609.   2  CARD16         minor opcode
  3610.   1  CARD8         major opcode
  3611.   21             unused
  3612.  
  3613.  
  3614.  
  3615. Alloc
  3616.   1  0             Error
  3617.   1  11          code
  3618.   2  CARD16         sequence number
  3619.   4             unused
  3620.   2  CARD16         minor opcode
  3621.   1  CARD8         major opcode
  3622.   21             unused
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.                  52
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634. X Input Extension Protocol Specification    X11, Release 6.4
  3635.  
  3636.  
  3637. Name
  3638.   1  0             Error
  3639.   1  15          code
  3640.   2  CARD16         sequence number
  3641.   4             unused
  3642.   2  CARD16         minor opcode
  3643.   1  CARD8         major opcode
  3644.   21             unused
  3645.  
  3646.  
  3647.  
  3648. Device
  3649.   1  0             Error
  3650.   1  CARD8         code
  3651.   2  CARD16         sequence number
  3652.   4             unused
  3653.   2  CARD16         minor opcode
  3654.   1  CARD8         major opcode
  3655.   21             unused
  3656.  
  3657.  
  3658.  
  3659. Event
  3660.   1  0             Error
  3661.   1  CARD8         code
  3662.   2  CARD16         sequence number
  3663.   4             unused
  3664.   2  CARD16         minor opcode
  3665.   1  CARD8         major opcode
  3666.   21             unused
  3667.  
  3668.  
  3669.  
  3670. Mode
  3671.   1  0             Error
  3672.   1  CARD8         code
  3673.   2  CARD16         sequence number
  3674.   4             unused
  3675.   2  CARD16         minor opcode
  3676.   1  CARD8         major opcode
  3677.   21             unused
  3678.  
  3679.  
  3680.  
  3681. Class
  3682.   1  0             Error
  3683.   1  CARD8         code
  3684.   2  CARD16         sequence number
  3685.   4             unused
  3686.   2  CARD16         minor opcode
  3687.   1  CARD8         major opcode
  3688.   21             unused
  3689.  
  3690. Keyboards
  3691.  
  3692.  
  3693.  
  3694.                  53
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700. X Input Extension Protocol Specification    X11, Release 6.4
  3701.  
  3702.  
  3703. KEYCODE values are always greater than 7 (and less than
  3704. 256).
  3705.  
  3706. KEYSYM values with the bit #x10000000 set are reserved as
  3707. vendor-specific.
  3708.  
  3709. The names and encodings of the standard KEYSYM values are
  3710. contained in appendix F.
  3711.  
  3712. Pointers
  3713.  
  3714. BUTTON values are numbered starting with one.
  3715.  
  3716. Requests
  3717.  
  3718.  
  3719. GetExtensionVersion
  3720.   1  CARD8         input extension opcode
  3721.   1  1             GetExtensionVersion opcode
  3722.   2  2+(n+p)/4         request length
  3723.   2  n             length of name
  3724.   2             unused
  3725.   n  STRING8         name
  3726.   p             unused, p=pad(n)
  3727.  
  3728.  
  3729.  =>
  3730.   1  1             Reply
  3731.   1  1             GetExtensionVersion opcode
  3732.   2  CARD16         sequence number
  3733.   4  0             reply length
  3734.   2  CARD16         major version
  3735.   2  CARD16         minor version
  3736.   1  BOOL         present
  3737.   19             unused
  3738.  
  3739.  
  3740.  
  3741. ListInputDevices
  3742.   1  CARD8         input extension opcode
  3743.   1  2             ListInputDevices opcode
  3744.   2  1             request length
  3745.  
  3746.  
  3747.  =>
  3748.   1  1             Reply
  3749.   1  2             ListInputDevices opcode
  3750.   2  CARD16         sequence number
  3751.   4  (n+p)/4         reply length
  3752.   1  CARD8         number of input devices
  3753.   23             unused
  3754.   n  LISTofDEVICEINFO     info for each input device
  3755.   p             unused, p=pad(n)
  3756.  
  3757.  
  3758.  
  3759.  
  3760.                  54
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766. X Input Extension Protocol Specification    X11, Release 6.4
  3767.  
  3768.  
  3769.   DEVICEINFO
  3770.   4  CARD32         device type
  3771.   1  CARD8         device id
  3772.   1  CARD8         number of input classes this device reports
  3773.   1  CARD8         device use
  3774.            0     IsXPointer
  3775.            1     IsXKeyboard
  3776.            2     IsXExtensionDevice
  3777.   1             unused
  3778.   n  LISTofINPUTINFO     input info for each input class
  3779.   m  STR         name
  3780.   p             unused, p=pad(m)
  3781.  
  3782.  
  3783.  
  3784.   INPUTINFO    KEYINFO or BUTTONINFO or VALUATORINFO
  3785.  
  3786.  
  3787.  
  3788.   KEYINFO
  3789.   1  0             class id
  3790.   1  8             length
  3791.   1  KEYCODE         minimum keycode
  3792.   1  KEYCODE         maximum keycode
  3793.   2  CARD16         number of keys
  3794.   2             unused
  3795.  
  3796.  
  3797.  
  3798. BUTTONINFO
  3799.   1  1             class id
  3800.   1  4             length
  3801.   2  CARD16         number of buttons
  3802.  
  3803.  
  3804.  
  3805. VALUATORINFO
  3806.   1    2              class id
  3807.   1    8+12n              length
  3808.   1    n              number of axes
  3809.   1    SETofDEVICEMODE          mode
  3810.   4    CARD32              size of motion buffer
  3811.   12n  LISTofAXISINFO          valuator limits
  3812.  
  3813.  
  3814.  
  3815. AXISINFO
  3816.   4  CARD32         resolution
  3817.   4  CARD32         minimum value
  3818.   4  CARD32         maximum value
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.                  55
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832. X Input Extension Protocol Specification    X11, Release 6.4
  3833.  
  3834.  
  3835. OpenDevice
  3836.   1  CARD8         input extension opcode
  3837.   1  3             OpenDevice opcode
  3838.   2  2             request length
  3839.   1  CARD8         device id
  3840.   3             unused
  3841.  
  3842.  
  3843.  =>
  3844.   1  1                   Reply
  3845.   1  3                   OpenDevice opcode
  3846.   2  CARD16               sequence number
  3847.   4  (n+p)/4               reply length
  3848.   1  CARD8               number of input classes
  3849.   23                   unused
  3850.   n  LISTofINPUTCLASSINFO       input class information
  3851.   p                   unused, p=pad(n)
  3852.  
  3853.  
  3854.  
  3855.   INPUTCLASSINFO
  3856.   1  CARD8         input class id
  3857.      0           KEY
  3858.      1           BUTTON
  3859.      2           VALUATOR
  3860.      3           FEEDBACK
  3861.      4           PROXIMITY
  3862.      5           FOCUS
  3863.      6           OTHER
  3864.   1  CARD8         event type base code for this class
  3865.  
  3866.  
  3867.  
  3868. CloseDevice
  3869.   1  CARD8         input extension opcode
  3870.   1  4             CloseDevice opcode
  3871.   2  2             request length
  3872.   1  CARD8         device id
  3873.   3             unused
  3874.  
  3875.  
  3876.  
  3877. SetDeviceMode
  3878.   1  CARD8         input extension opcode
  3879.   1  5             SetDeviceMode opcode
  3880.   2  2             request length
  3881.   1  CARD8         device id
  3882.   1  CARD8         mode
  3883.   2             unused
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.                  56
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898. X Input Extension Protocol Specification    X11, Release 6.4
  3899.  
  3900.  
  3901.  =>
  3902.   1  1                   Reply
  3903.   1  5                   SetDeviceMode opcode
  3904.   2  CARD16               sequence number
  3905.   4  0                   reply length
  3906.   1  CARD8               status
  3907.      0                   Success
  3908.            1           AlreadyGrabbed
  3909.      3 + first_error           DeviceBusy
  3910.   23                   unused
  3911.  
  3912.  
  3913.  
  3914. SelectExtensionEvent
  3915.   1  CARD8         input extension opcode
  3916.   1  6             SelectExtensionEvent opcode
  3917.   2  3+n         request length
  3918.   4  Window         event window
  3919.   2  CARD16         count
  3920.   2             unused
  3921.   4n LISTofEVENTCLASS     desired events
  3922.  
  3923.  
  3924.  
  3925. GetSelectedExtensionEvents
  3926.   1  CARD8         input extension opcode
  3927.   1  7             GetSelectedExtensionEvents opcode
  3928.   2  2             request length
  3929.   4  Window         event window
  3930.  
  3931.  
  3932.  =>
  3933.   1  1             Reply
  3934.   1  7             GetSelecteExtensionEvents opcode
  3935.   2  CARD16         sequence number
  3936.   4  n + m         reply length
  3937.   2  n             this client count
  3938.   2  m             all clients count
  3939.   20             unused
  3940.   4n LISTofEVENTCLASS     this client list
  3941.   4m LISTofEVENTCLASS     all clients list
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.                  57
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964. X Input Extension Protocol Specification    X11, Release 6.4
  3965.  
  3966.  
  3967. ChangeDeviceDontPropagateList
  3968.   1  CARD8         input extension opcode
  3969.   1  8             ChangeDeviceDontPropagateList opcode
  3970.   2  3+n         request length
  3971.   4  Window         event window
  3972.   2  n             count of events
  3973.   1  mode
  3974.      0           AddToList
  3975.      1           DeleteFromList
  3976.   1             unused
  3977.   4n LISTofEVENTCLASS     desired events
  3978.  
  3979.  
  3980.  
  3981. GetDeviceDontPropagateList
  3982.   1  CARD8         input extension opcode
  3983.   1  9             GetDeviceDontPropagateList opcode
  3984.   2  2             request length
  3985.   4  Window         event window
  3986.  
  3987.  
  3988.  =>
  3989.   1  1             Reply
  3990.   1  9             GetDeviceDontPropagateList opcode
  3991.   2  CARD16         sequence number
  3992.   4  n             reply length
  3993.   2  n             count of events
  3994.   22             unused
  3995.   4n LISTofEVENTCLASS     don't propagate list
  3996.  
  3997.  
  3998.  
  3999. GetDeviceMotionEvents
  4000.   1  CARD8         input extension opcode
  4001.   1  10          GetDeviceMotionEvents opcode
  4002.   2  4             request length
  4003.   4  TIMESTAMP         start
  4004.      0           CurrentTime
  4005.   4  TIMESTAMP         stop
  4006.      0           CurrentTime
  4007.   1  CARD8         device id
  4008.   3             unused
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.                  58
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030. X Input Extension Protocol Specification    X11, Release 6.4
  4031.  
  4032.  
  4033.  =>
  4034.   1           1           Reply
  4035.   1           10           GetDeviceMotionEvents opcode
  4036.   2           CARD16           sequence number
  4037.   4           (m+1)n           reply length
  4038.   4           n           number of DEVICETIMECOORDs in events
  4039.   1           m           number of valuators per event
  4040.   1           CARD8           mode of the device
  4041.            0           Absolute
  4042.            1           Relative
  4043.   18                   unused
  4044.   (4m+4)n      LISTofDEVICETIMECOORDevents
  4045.  
  4046.  
  4047.  
  4048.   DEVICETIMECOORD
  4049.   4  TIMESTAMP         time
  4050.   4m LISTofINT32     valuators
  4051.  
  4052.  
  4053.  
  4054. ChangeKeyboardDevice
  4055.   1  CARD8         input extension opcode
  4056.   1  11          ChangeKeyboardDevice opcode
  4057.   2  2             request length
  4058.   1  CARD8         device id
  4059.   3             unused
  4060.  
  4061.  
  4062.  =>
  4063.   1  1             Reply
  4064.   1  11          ChangeKeyboardDevice opcode
  4065.   2  CARD16         sequence number
  4066.   4  0             reply length
  4067.   1             status
  4068.      0           Success
  4069.      1           AlreadyGrabbed
  4070.      2           DeviceFrozen
  4071.   23             unused
  4072.  
  4073.  
  4074.  
  4075. ChangePointerDevice
  4076.   1  CARD8         input extension opcode
  4077.   1  12          ChangePointerDevice opcode
  4078.   2  2             request length
  4079.   1  CARD8         x-axis
  4080.   1  CARD8         y-axis
  4081.   1  CARD8         device id
  4082.   1             unused
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.                  59
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096. X Input Extension Protocol Specification    X11, Release 6.4
  4097.  
  4098.  
  4099.  =>
  4100.   1  1             Reply
  4101.   1  12          ChangePointerDevice opcode
  4102.   2  CARD16         sequence number
  4103.   4  0             reply length
  4104.   1             status
  4105.      0           Success
  4106.      1           AlreadyGrabbed
  4107.      2           DeviceFrozen
  4108.   23             unused
  4109.  
  4110.  
  4111.  
  4112. GrabDevice
  4113.   1  CARD8         input extension opcode
  4114.   1  13          GrabDevice opcode
  4115.   2  5+n         request length
  4116.   4  WINDOW         grab-window
  4117.   4  TIMESTAMP         time
  4118.      0           CurrentTime
  4119.   2  n             count of events
  4120.   1             this-device-mode
  4121.      0           Synchronous
  4122.      1           Asynchronous
  4123.   1             other-devices-mode
  4124.      0           Synchronous
  4125.      1           Asynchronous
  4126.   1  BOOL         owner-events
  4127.   1  CARD8         device id
  4128.   2             unused
  4129.   4n LISTofEVENTCLASS     event list
  4130.  
  4131.  
  4132.  =>
  4133.   1  1             Reply
  4134.   1  13          GrabDevice opcode
  4135.   2  CARD16         sequence number
  4136.   4  0             reply length
  4137.   1             status
  4138.      0           Success
  4139.      1           AlreadyGrabbed
  4140.      2           InvalidTime
  4141.      3           NotViewable
  4142.      4           Frozen
  4143.   23             unused
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.                  60
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162. X Input Extension Protocol Specification    X11, Release 6.4
  4163.  
  4164.  
  4165. UngrabDevice
  4166.   1  CARD8         input extension opcode
  4167.   1  14          UngrabDevice opcode
  4168.   2  3             request length
  4169.   4  TIMESTAMP         time
  4170.      0           CurrentTime
  4171.   1  CARD8         device id
  4172.   3             unused
  4173.  
  4174.  
  4175.  
  4176. GrabDeviceKey
  4177.   1  CARD8         input extension opcode
  4178.   1  15          GrabDeviceKey opcode
  4179.   2  5+n         request length
  4180.   4  WINDOW         grab-window
  4181.   2  n             count of events
  4182.   2  SETofKEYMASK     modifiers
  4183.      #x8000    AnyModifier
  4184.   1  CARD8         modifier device
  4185.      #x0FF     UseXKeyboard
  4186.   1  CARD8         grabbed device
  4187.   1  KEYCODE         key
  4188.      0           AnyKey
  4189.   1             this-device-mode
  4190.      0           Synchronous
  4191.      1           Asynchronous
  4192.   1             other-devices-mode
  4193.      0           Synchronous
  4194.      1           Asynchronous
  4195.   1  BOOL         owner-events
  4196.   2             unused
  4197.   4n LISTofEVENTCLASS     event list
  4198.  
  4199.  
  4200.  
  4201. UngrabDeviceKey
  4202.   1  CARD8         input extension opcode
  4203.   1  16          UngrabDeviceKey opcode
  4204.   2  4             request length
  4205.   4  WINDOW         grab-window
  4206.   2  SETofKEYMASK     modifiers
  4207.      #x8000    AnyModifier
  4208.   1  CARD8         modifier device
  4209.      #x0FF     UseXKeyboard
  4210.   1  KEYCODE         key
  4211.      0           AnyKey
  4212.   1  CARD8         grabbed device
  4213.   3             unused
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.                  61
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228. X Input Extension Protocol Specification    X11, Release 6.4
  4229.  
  4230.  
  4231. GrabDeviceButton
  4232.   1  CARD8         input extension opcode
  4233.   1  17          GrabDeviceButton opcode
  4234.   2  5+n         request length
  4235.   4  WINDOW         grab-window
  4236.   1  CARD8         grabbed device
  4237.   1  CARD8         modifier device
  4238.      #x0FF     UseXKeyboard
  4239.   2  n             count of desired events
  4240.   2  SETofKEYMASK     modifiers
  4241.   1             this-device-mode
  4242.      0           Synchronous
  4243.      1           Asynchronous
  4244.   1             other-device-mode
  4245.      0           Synchronous
  4246.      1           Asynchronous
  4247.   1  BUTTON         button
  4248.      0           AnyButton
  4249.   1  BOOL         owner-events
  4250.      #x8000    AnyModifier
  4251.   2             unused
  4252.   4n LISTofEVENTCLASS     event list
  4253.  
  4254.  
  4255.  
  4256. UngrabDeviceButton
  4257.   1  CARD8         input extension opcode
  4258.   1  18          UngrabDeviceButton opcode
  4259.   2  4             request length
  4260.   4  WINDOW         grab-window
  4261.   2  SETofKEYMASK     modifiers
  4262.      #x8000    AnyModifier
  4263.   1  CARD8         modifier device
  4264.      #x0FF     UseXKeyboard
  4265.   1  BUTTON         button
  4266.      0           AnyButton
  4267.   1  CARD8         grabbed device
  4268.   3             unused
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.                  62
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294. X Input Extension Protocol Specification    X11, Release 6.4
  4295.  
  4296.  
  4297. AllowDeviceEvents
  4298.   1  CARD8         input extension opcode
  4299.   1  19          AllowDeviceEvents opcode
  4300.   2  3             request length
  4301.   4  TIMESTAMP         time
  4302.      0           CurrentTime
  4303.   1             mode
  4304.      0           AsyncThisDevice
  4305.      1           SyncThisDevice
  4306.      2           ReplayThisDevice
  4307.      3           AsyncOtherDevices
  4308.      4           AsyncAll
  4309.      5           SyncAll
  4310.   1  CARD8         device id
  4311.   2             unused
  4312.  
  4313.  
  4314.  
  4315. GetDeviceFocus
  4316.   1  CARD8         input extension opcode
  4317.   1  20          GetDeviceFocus opcode
  4318.   2  2             request length
  4319.   1  CARD8         device
  4320.   3             unused
  4321.  
  4322.  
  4323.  =>
  4324.   1  1             Reply
  4325.   1  20          GetDeviceFocus opcode
  4326.   2  CARD16         sequence number
  4327.   4  0             reply length
  4328.   4  WINDOW         focus
  4329.      0           None
  4330.      1           PointerRoot
  4331.      3           FollowKeyboard
  4332.   4  TIMESTAMP focus time
  4333.   1             revert-to
  4334.      0           None
  4335.      1           PointerRoot
  4336.      2           Parent
  4337.      3           FollowKeyboard
  4338.   15             unused
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.                  63
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360. X Input Extension Protocol Specification    X11, Release 6.4
  4361.  
  4362.  
  4363. SetDeviceFocus
  4364.   1  CARD8         input extension opcode
  4365.   1  21          SetDeviceFocus opcode
  4366.   2  4             request length
  4367.   4  WINDOW         focus
  4368.      0           None
  4369.      1           PointerRoot
  4370.      3           FollowKeyboard
  4371.   4  TIMESTAMP         time
  4372.      0           CurrentTime
  4373.   1             revert-to
  4374.      0           None
  4375.      1           PointerRoot
  4376.      2           Parent
  4377.      3           FollowKeyboard
  4378.   1  CARD8         device
  4379.   2             unused
  4380.  
  4381.  
  4382.  
  4383. GetFeedbackControl
  4384.   1  CARD8         input extension opcode
  4385.   1  22          GetFeedbackControl opcode
  4386.   2  2             request length
  4387.   1  CARD8         device id
  4388.   3             unused
  4389.  
  4390.  
  4391.  =>
  4392.   1  1             Reply
  4393.   1  22          GetFeedbackControl opcode
  4394.   2  CARD16         sequence number
  4395.   4  m/4         reply length
  4396.   2  n             number of feedbacks supported
  4397.   22             unused
  4398.   m  LISTofFEEDBACKSTATE feedbacks
  4399.  
  4400.  
  4401.  
  4402.   FEEDBACKSTATE      KBDFEEDBACKSTATE, PTRFEEDBACKSTATE, INTEGERFEEDBACKSTATE,
  4403.   STRINGFEEDBACKSTATE, BELLFEEDBACKSTATE, or LEDFEEDBACKSTATE
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.                  64
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426. X Input Extension Protocol Specification    X11, Release 6.4
  4427.  
  4428.  
  4429.   KBDFEEDBACKSTATE
  4430.   1  0             feedback class id
  4431.   1  CARD8         id of this feedback
  4432.   2  20          length
  4433.   2  CARD16         pitch
  4434.   2  CARD16         duration
  4435.   4  CARD32         led_mask
  4436.   4  CARD32         led_values
  4437.   1             global_auto_repeat
  4438.      0           Off
  4439.      1           On
  4440.   1  CARD8         click
  4441.   1  CARD8         percent
  4442.   1             unused
  4443.   32 LISTofCARD8     auto_repeats
  4444.  
  4445.  
  4446.  
  4447.   PTRFEEDBACKSTATE
  4448.   1  0             feedback class id
  4449.   1  CARD8         id of this feedback
  4450.   2  12          length
  4451.   2             unused
  4452.   2  CARD16         acceleration-numerator
  4453.   2  CARD16         acceleration-denominator
  4454.   2  CARD16         threshold
  4455.  
  4456.  
  4457.  
  4458.   INTEGERFEEDBACKSTATE
  4459.   1  0             feedback class id
  4460.   1  CARD8         id of this feedback
  4461.   2  16          length
  4462.   4  CARD32         resolution
  4463.   4  INT32         minimum value
  4464.   4  INT32         maximum value
  4465.  
  4466.  
  4467.  
  4468.   STRINGFEEDBACKSTATE
  4469.   1  1             feedback class id
  4470.   1  CARD8         id of this feedback
  4471.   2  4n+8         length
  4472.   2  CARD16         max_symbols
  4473.   2  n             number of keysyms supported
  4474.   4n LISTofKEYSYM     key symbols supported
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.                  65
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492. X Input Extension Protocol Specification    X11, Release 6.4
  4493.  
  4494.  
  4495.   BELLFEEDBACKSTATE
  4496.   1  1             feedback class id
  4497.   1  CARD8         id of this feedback
  4498.   2  12          length
  4499.   1  CARD8         percent
  4500.   3             unused
  4501.   2  CARD16         pitch
  4502.   2  CARD16         duration
  4503.  
  4504.  
  4505.  
  4506.   LEDFEEDBACKSTATE
  4507.   1  1             feedback class id
  4508.   1  CARD8         id of this feedback
  4509.   2  12          length
  4510.   4  CARD32         led_mask
  4511.   4  BITMASK         led_values
  4512.      #x0001    On
  4513.      #x0002    Off
  4514.  
  4515.  
  4516.  
  4517. ChangeFeedbackControl
  4518.   1  CARD8         input extension opcode
  4519.   1  23          ChangeFeedbackControl opcode
  4520.   2  3+n/4         request length
  4521.   4  BITMASK         value-mask (has n bits set to 1)
  4522.      #x0001    keyclick-percent
  4523.      #x0002    bell-percent
  4524.      #x0004    bell-pitch
  4525.      #x0008    bell-duration
  4526.      #x0010    led
  4527.      #x0020    led-mode
  4528.      #x0040    key
  4529.      #x0080    auto-repeat-mode
  4530.      #x0001    string
  4531.      #x0001    integer
  4532.      #x0001    acceleration-numerator
  4533.      #x0002    acceleration-denominator
  4534.      #x0004    acceleration-threshold
  4535.   1  CARD8         device id
  4536.   1  CARD8         feedback class id
  4537.   2             unused
  4538.   n  FEEDBACKCLASS
  4539.  
  4540.  
  4541.  
  4542.   FEEDBACKCLASS      KBDFEEDBACKCTL, PTRFEEDBACKCTL, INTEGERFEEDBACKCTL,
  4543.   STRINGFEEDBACKCTL, BELLFEEDBACKCTL, or LEDFEEDBACKCTL
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.                  66
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558. X Input Extension Protocol Specification    X11, Release 6.4
  4559.  
  4560.  
  4561.   KBDFEEDBACKCTL
  4562.   1  0             feedback class id
  4563.   1  CARD8         id of this feedback
  4564.   2  20          length
  4565.   1  KEYCODE         key
  4566.   1             auto-repeat-mode
  4567.      0           Off
  4568.      1           On
  4569.      2           Default
  4570.   1  INT8         key-click-percent
  4571.   1  INT8         bell-percent
  4572.   2  INT16         bell-pitch
  4573.   2  INT16         bell-duration
  4574.   4  CARD32         led_mask
  4575.   4  CARD32         led_values
  4576.  
  4577.  
  4578.  
  4579.   PTRFEEDBACKCTL
  4580.   1  1             feedback class id
  4581.   1  CARD8         id of this feedback
  4582.   2  12          length
  4583.   2             unused
  4584.   2  INT16         numerator
  4585.   2  INT16         denominator
  4586.   2  INT16         threshold
  4587.  
  4588.  
  4589.  
  4590.   STRINGCTL
  4591.   1  2             feedback class id
  4592.   1  CARD8         id of this feedback
  4593.   2  4n+8         length
  4594.   2             unused
  4595.   2  n             number of keysyms to display
  4596.   4n LISTofKEYSYM     list of key symbols to display
  4597.  
  4598.  
  4599.  
  4600.   INTEGERCTL
  4601.   1  3             feedback class id
  4602.   1  CARD8         id of this feedback
  4603.   2  8             length
  4604.   4  INT32         integer to display
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.  
  4618.                  67
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624. X Input Extension Protocol Specification    X11, Release 6.4
  4625.  
  4626.  
  4627.   LEDCTL
  4628.   1  4             feedback class id
  4629.   1  CARD8         id of this feedback
  4630.   2  12          length
  4631.   4  CARD32         led_mask
  4632.   4  BITMASK         led_values
  4633.      #x0001    On
  4634.      #x0002    Off
  4635.  
  4636.  
  4637.  
  4638.   BELLCTL
  4639.   1  5             feedback class id
  4640.   1  CARD8         id of this feedback
  4641.   2  8             length
  4642.   1  INT8         percent
  4643.   3             unused
  4644.   2  INT16         pitch
  4645.   2  INT16         duration
  4646.  
  4647.  
  4648.  
  4649. GetDeviceKeyMapping
  4650.   1  CARD8         input extension opcode
  4651.   1  24          GetDeviceKeyMapping opcode
  4652.   2  2             request length
  4653.   1  CARD8         device
  4654.   1  KEYCODE         first-keycode
  4655.   1  CARD8         count
  4656.   1             unused
  4657.  
  4658.  
  4659.  =>
  4660.   1    1              Reply
  4661.   1    24              GetDeviceKeyMapping opcode
  4662.   2    CARD16              sequence number
  4663.   4    nm              reply length (m = count field from the request)
  4664.   1    n              keysyms-per-keycode
  4665.   23                  unused
  4666.   4nm  LISTofKEYSYM          keysyms
  4667.  
  4668.  
  4669.  
  4670. ChangeDeviceKeyMapping
  4671.   1    CARD8              input extension opcode
  4672.   1    25              ChangeDeviceKeyMapping opcode
  4673.   2    2+nm              request length
  4674.   1    CARD8              device
  4675.   1    KEYCODE              first-keycode
  4676.   1    m              keysyms-per-keycode
  4677.   1    n              keycode-count
  4678.   4nm  LISTofKEYSYM          keysyms
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.                  68
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690. X Input Extension Protocol Specification    X11, Release 6.4
  4691.  
  4692.  
  4693. GetDeviceModifierMapping
  4694.   1  CARD8         input extension opcode
  4695.   1  26          GetDeviceModifierMapping opcode
  4696.   2  2             request length
  4697.   1  CARD8         device
  4698.   3             unused
  4699.  
  4700.  
  4701.  =>
  4702.   1  1             Reply
  4703.   1  26          GetDeviceModifierMapping opcode
  4704.   2  CARD16         sequence number
  4705.   4  2n          reply length
  4706.   1  n             keycodes-per-modifier
  4707.   23             unused
  4708.   8n LISTofKEYCODE     keycodes
  4709.  
  4710.  
  4711.  
  4712. SetDeviceModifierMapping
  4713.   1  CARD8         input extension opcode
  4714.   1  27          SetDeviceModifier opcode
  4715.   2  2+2n         request length
  4716.   1  CARD8         device
  4717.   1  n             keycodes-per-modifier
  4718.   2             unused
  4719.   8n LISTofKEYCODE     keycodes
  4720.  
  4721.  
  4722.  =>
  4723.   1  1             Reply
  4724.   1  27          SetDeviceModifierMapping opcode
  4725.   2  CARD16         sequence number
  4726.   4  0             reply length
  4727.   1             status
  4728.      0           Success
  4729.      1           Busy
  4730.      2           Failed
  4731.   23             unused
  4732.  
  4733.  
  4734.  
  4735. GetDeviceButtonMapping
  4736.   1  CARD8         input extension opcode
  4737.   1  28          GetDeviceButtonMapping opcode
  4738.   2  2             request length
  4739.   1  CARD8         device
  4740.   3             unused
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.                  69
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756. X Input Extension Protocol Specification    X11, Release 6.4
  4757.  
  4758.  
  4759.  =>
  4760.   1  1             Reply
  4761.   1  28          GetDeviceButtonMapping opcode
  4762.   2  CARD16         sequence number
  4763.   4  (n+p)/4         reply length
  4764.   1  n             number of elements in map list
  4765.   23             unused
  4766.   n  LISTofCARD8     map
  4767.   p             unused, p=pad(n)
  4768.  
  4769.  
  4770.  
  4771. SetDeviceButtonMapping
  4772.   1  CARD8         input extension opcode
  4773.   1  29          SetDeviceButtonMapping opcode
  4774.   2  2+(n+p)/4         request length
  4775.   1  CARD8         device
  4776.   1  n             length of map
  4777.   2             unused
  4778.   n  LISTofCARD8     map
  4779.   p             unused, p=pad(n)
  4780.  
  4781.  
  4782.  =>
  4783.   1  1             Reply
  4784.   1  29          SetDeviceButtonMapping opcode
  4785.   2  CARD16         sequence number
  4786.   4  0             reply length
  4787.   1             status
  4788.      0           Success
  4789.      1           Busy
  4790.   23             unused
  4791.  
  4792.  
  4793.  
  4794. QueryDeviceState
  4795.   1  CARD8         input extension opcode
  4796.   1  30          QueryDeviceState opcode
  4797.   2  2             request length
  4798.   1  CARD8         device
  4799.   3             unused
  4800.  
  4801.  
  4802.  =>
  4803.   1  1             Reply
  4804.   1  30          QueryDeviceState opcode
  4805.   2  CARD16         sequence number
  4806.   4  m/4         reply length
  4807.   1  n             number of input classes
  4808.   23             unused
  4809.   m  LISTofINPUTSTATE
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.                  70
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822. X Input Extension Protocol Specification    X11, Release 6.4
  4823.  
  4824.  
  4825.   INPUTSTATE   KEYSTATE or BUTTONSTATE or VALUATORSTATE
  4826.  
  4827.  
  4828.  
  4829.   KEYSTATE
  4830.   1  CARD8         key input class id
  4831.   1  36          length
  4832.   1  CARD8         num_keys
  4833.   1             unused
  4834.   32 LISTofCARD8     status of keys
  4835.  
  4836.  
  4837.   BUTTONSTATE
  4838.   1  CARD8         button input class id
  4839.   1  36          length
  4840.   1  CARD8         num_buttons
  4841.   1             unused
  4842.   32 LISTofCARD8     status of buttons
  4843.  
  4844.  
  4845.   VALUATORSTATE
  4846.   1  CARD8         valuator input class id
  4847.   1  4n + 4         length
  4848.   1  n             number of valuators
  4849.   1             mode
  4850.      #x01      DeviceMode (0 = Relative, 1 = Absolute)
  4851.      #x02      ProximityState (0 = InProximity, 1 = OutOfProximity)
  4852.   4n LISTofCARD32     status of valuators
  4853.  
  4854.  
  4855.  
  4856. SendExtensionEvent
  4857.   1  CARD8         input extension opcode
  4858.   1  31          SendExtensionEvent opcode
  4859.   2  4 + 8n + m      request length
  4860.   4  WINDOW         destination
  4861.   1  CARD8         device
  4862.   1  BOOL         propagate
  4863.   2  CARD16         eventclass count
  4864.   1  CARD8         num_events
  4865.   3             unused
  4866.   32n           LISTofEVENTSevents to send
  4867.   4m LISTofEVENTCLASS     desired events
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.                  71
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888. X Input Extension Protocol Specification    X11, Release 6.4
  4889.  
  4890.  
  4891. DeviceBell
  4892.   1  CARD8         input extension opcode
  4893.   1  32          DeviceBell opcode
  4894.   2  2             request length
  4895.   1  CARD8         device id
  4896.   1  CARD8         feedback id
  4897.   1  CARD8         feedback class
  4898.   1  INT8         percent
  4899.  
  4900.  
  4901.  
  4902. SetDeviceValuators
  4903.   1  CARD8         input extension opcode
  4904.   1  33          SetDeviceValuators opcode
  4905.   2  2 + n         request length
  4906.   1  CARD8         device id
  4907.   1  CARD8         first valuator
  4908.   1  n             number of valuators
  4909.   1             unused
  4910.   4n LISTofINT32     valuator values to set
  4911.  
  4912.  
  4913.  =>
  4914.   1  1                   Reply
  4915.   1  33                SetDeviceValuators opcode
  4916.   2  CARD16               sequence number
  4917.   4  0                   reply length
  4918.   1  CARD8               status
  4919.      0           Success
  4920.      1           AlreadyGrabbed
  4921.   23                   unused
  4922.  
  4923.  
  4924.  
  4925. GetDeviceControl
  4926.   1  CARD8         input extension opcode
  4927.   1  34          GetDeviceControl opcode
  4928.   2  2             request length
  4929.   2  CARD16         device control type
  4930.   1  CARD8         device id
  4931.   1             unused
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.                  72
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954. X Input Extension Protocol Specification    X11, Release 6.4
  4955.  
  4956.  
  4957.  =>
  4958.   1  1                   Reply
  4959.   1  34                GetDeviceControl opcode
  4960.   2  CARD16               sequence number
  4961.   4  n/4               reply length
  4962.   1  CARD8               status
  4963.      0                   Success
  4964.      1                   AlreadyGrabbed
  4965.      3 + first_error           DeviceBusy
  4966.   23                   unused
  4967.   n                   DEVICESTATE
  4968.  
  4969.  
  4970. DEVICESTATE         DEVICERESOLUTIONSTATE
  4971.  
  4972.  
  4973.  
  4974. DEVICERESOLUTIONSTATE
  4975.   2  0             control type
  4976.   2  8 + 12n         length
  4977.   4  n             num_valuators
  4978.   4n LISTOfCARD32     resolution values
  4979.   4n LISTOfCARD32     resolution min_values
  4980.   4n LISTOfCARD32     resolution max_values
  4981.  
  4982.  
  4983.  
  4984.  
  4985. ChangeDeviceControl
  4986.   1  CARD8         input extension opcode
  4987.   1  35          ChangeDeviceControl opcode
  4988.   2  2+n/4         request length
  4989.   2  CARD16         control type
  4990.   1  CARD8         device id
  4991.   1             unused
  4992.   n             DEVICECONTROL
  4993.  
  4994.  
  4995. DEVICECONTROL         DEVICERESOLUTIONCTL
  4996.  
  4997.  
  4998.  
  4999. DEVICERESOLUTIONCTL
  5000.   2  1             control type
  5001.   2  8 + 4n         length
  5002.   1  CARD8         first_valuator
  5003.   1  n             num_valuators
  5004.   2             unused
  5005.   4n LISTOfCARD32     resolution values
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.                  73
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020. X Input Extension Protocol Specification    X11, Release 6.4
  5021.  
  5022.  
  5023.  =>
  5024.   1  1                   Reply
  5025.   1  35                ChangeDeviceControl opcode
  5026.   2  CARD16               sequence number
  5027.   4  0                   reply length
  5028.   1  CARD8               status
  5029.      0                   Success
  5030.      1                   AlreadyGrabbed
  5031.      3 + first_error           DeviceBusy
  5032.   23                   unused
  5033.  
  5034. Events
  5035.  
  5036. DeviceKeyPress, DeviceKeyRelease, DeviceButtonPress, Device-
  5037. ButtonRelease, ProximityIn, ProximityOut, and DeviceStateNo-
  5038. tify  events may be followed by zero or more DeviceValuator
  5039. events.  DeviceMotionNotify events will be followed by one
  5040. or more DeviceValuator events.
  5041.  
  5042.  
  5043. DeviceValuator
  5044.   1  CARD8         code
  5045.   1  CARD8         device id
  5046.   2  CARD16         sequence number
  5047.   2  SETofKEYBUTMASK     state
  5048.   1  n             number of valuators this device reports
  5049.   1  m             number of first valuator in this event
  5050.   24 LISTofINT32     valuators
  5051.  
  5052.  
  5053.  
  5054. DeviceKeyPress
  5055.   1  CARD8         code
  5056.   1  KEYCODE         detail
  5057.   2  CARD16         sequence number
  5058.   4  TIMESTAMP         time
  5059.   4  WINDOW         root
  5060.   4  WINDOW         event
  5061.   4  WINDOW         child
  5062.      0           None
  5063.   2  INT16         root-x
  5064.   2  INT16         root-y
  5065.   2  INT16         event-x
  5066.   2  INT16         event-y
  5067.   2  SETofKEYBUTMASK     state
  5068.   1  BOOL         same-screen
  5069.   1  CARD8         device id
  5070.      #x80         MORE_EVENTS follow
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.                  74
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086. X Input Extension Protocol Specification    X11, Release 6.4
  5087.  
  5088.  
  5089. DeviceKeyRelease
  5090.   1  CARD8         code
  5091.   1  KEYCODE         detail
  5092.   2  CARD16         sequence number
  5093.   4  TIMESTAMP         time
  5094.   4  WINDOW         root
  5095.   4  WINDOW         event
  5096.   4  WINDOW         child
  5097.      0           None
  5098.   2  INT16         root-x
  5099.   2  INT16         root-y
  5100.   2  INT16         event-x
  5101.   2  INT16         event-y
  5102.   2  SETofKEYBUTMASK     state
  5103.   1  BOOL         same-screen
  5104.   1  CARD8         device id
  5105.      #x80         MORE_EVENTS follow
  5106.  
  5107.  
  5108.  
  5109. DeviceButtonPress
  5110.   1  CARD8         code
  5111.   1  BUTTON         detail
  5112.   2  CARD16         sequence number
  5113.   4  TIMESTAMP         time
  5114.   4  WINDOW         root
  5115.   4  WINDOW         event
  5116.   4  WINDOW         child
  5117.      0           None
  5118.   2  INT16         root-x
  5119.   2  INT16         root-y
  5120.   2  INT16         event-x
  5121.   2  INT16         event-y
  5122.   2  SETofKEYBUTMASK     state
  5123.   1  BOOL         same-screen
  5124.   1  CARD8         device id
  5125.      #x80         MORE_EVENTS follow
  5126.  
  5127.  
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.                  75
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152. X Input Extension Protocol Specification    X11, Release 6.4
  5153.  
  5154.  
  5155. DeviceButtonRelease
  5156.   1  CARD8         code
  5157.   1  BUTTON         detail
  5158.   2  CARD16         sequence number
  5159.   4  TIMESTAMP         time
  5160.   4  WINDOW         root
  5161.   4  WINDOW         event
  5162.   4  WINDOW         child
  5163.      0           None
  5164.   2  INT16         root-x
  5165.   2  INT16         root-y
  5166.   2  INT16         event-x
  5167.   2  INT16         event-y
  5168.   2  SETofKEYBUTMASK     state
  5169.   1  BOOL         same-screen
  5170.   1  CARD8         device id
  5171.      #x80         MORE_EVENTS follow
  5172.  
  5173.  
  5174.  
  5175. DeviceMotionNotify
  5176.   1  CARD8         code
  5177.   1             detail
  5178.      0           Normal
  5179.      1           Hint
  5180.   2  CARD16         sequence number
  5181.   4  TIMESTAMP         time
  5182.   4  WINDOW         root
  5183.   4  WINDOW         event
  5184.   4  WINDOW         child
  5185.      0           None
  5186.   2  INT16         root-x
  5187.   2  INT16         root-y
  5188.   2  INT16         event-x
  5189.   2  INT16         event-y
  5190.   2  SETofKEYBUTMASK     state
  5191.   1  BOOL         same-screen
  5192.   1  CARD8         device id
  5193.      #x80         MORE_EVENTS follow
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.  
  5205.  
  5206.  
  5207.  
  5208.  
  5209.  
  5210.  
  5211.  
  5212.                  76
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218. X Input Extension Protocol Specification    X11, Release 6.4
  5219.  
  5220.  
  5221. DeviceFocusIn
  5222.   1  CARD8         code
  5223.   1             detail
  5224.      0           Ancestor
  5225.      1           Virtual
  5226.      2           Inferior
  5227.      3           Nonlinear
  5228.      4           NonlinearVirtual
  5229.      5           Pointer
  5230.      6           PointerRoot
  5231.      7           None
  5232.   2  CARD16         sequence number
  5233.   4  TIMESTAMP         time
  5234.   4  WINDOW         event
  5235.   1             mode
  5236.      0           Normal
  5237.      1           Grab
  5238.      2           Ungrab
  5239.      3           WhileGrabbed
  5240.   1  CARD8         device id
  5241.   18             unused
  5242.  
  5243.  
  5244.  
  5245. DeviceFocusOut
  5246.   1  CARD8         code
  5247.   1             detail
  5248.      0           Ancestor
  5249.      1           Virtual
  5250.      2           Inferior
  5251.      3           Nonlinear
  5252.      4           NonlinearVirtual
  5253.      5           Pointer
  5254.      6           PointerRoot
  5255.      7           None
  5256.   2  CARD16         sequence number
  5257.   4  TIMESTAMP         time
  5258.   4  WINDOW         event
  5259.   1             mode
  5260.      0           Normal
  5261.      1           Grab
  5262.      2           Ungrab
  5263.      3           WhileGrabbed
  5264.   1  CARD8         device id
  5265.   18             unused
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.                  77
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284. X Input Extension Protocol Specification    X11, Release 6.4
  5285.  
  5286.  
  5287. ProximityIn
  5288.   1  CARD8         code
  5289.   1             unused
  5290.   2  CARD16         sequence number
  5291.   4  TIMESTAMP         time
  5292.   4  WINDOW         root
  5293.   4  WINDOW         event
  5294.   4  WINDOW         child
  5295.      0           None
  5296.   2  INT16         root-x
  5297.   2  INT16         root-y
  5298.   2  INT16         event-x
  5299.   2  INT16         event-y
  5300.   2  SETofKEYBUTMASK     state
  5301.   1  BOOL         same-screen
  5302.   1  CARD8         device id
  5303.      #x80         MORE_EVENTS follow
  5304.  
  5305.  
  5306.  
  5307. ProximityOut
  5308.   1  CARD8         code
  5309.   1             unused
  5310.   2  CARD16         sequence number
  5311.   4  TIMESTAMP         time
  5312.   4  WINDOW         root
  5313.   4  WINDOW         event
  5314.   4  WINDOW         child
  5315.      0           None
  5316.   2  INT16         root-x
  5317.   2  INT16         root-y
  5318.   2  INT16         event-x
  5319.   2  INT16         event-y
  5320.   2  SETofKEYBUTMASK     state
  5321.   1  BOOL         same-screen
  5322.   1  CARD8         device id
  5323.      #x80         MORE_EVENTS follow
  5324.  
  5325.  
  5326. DeviceStateNotify events may be immediately followed by zero
  5327. or one DeviceKeyStateNotify and/ or zero or more DeviceValu-
  5328. ator events.
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.  
  5342.  
  5343.  
  5344.                  78
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350. X Input Extension Protocol Specification    X11, Release 6.4
  5351.  
  5352.  
  5353. DeviceStateNotify
  5354.   1  CARD8         code
  5355.   1  CARD8         device id
  5356.      #x80         MORE_EVENTS follow
  5357.   2  CARD16         sequence number
  5358.   4  TIMESTAMP         time
  5359.   1  CARD8         num_keys
  5360.   1  CARD8         num_buttons
  5361.   1  CARD8         num_valuators
  5362.   1  CARD8         valuator mode and input classes reported
  5363.      #x01      reporting keys
  5364.      #x02      reporting buttons
  5365.      #x04      reporting valuators
  5366.      #x40      device mode (0 = Relative, 1 = Absolute)
  5367.      #x80      proximity state (0 = InProximity, 1 = OutOfProximity)
  5368.   4  LISTofCARD8     first 32 keys (if reported)
  5369.   4  LISTofCARD8     first 32 buttons (if reported)
  5370.   12 LISTofCARD32     first 3 valuators (if reported)
  5371.  
  5372.  
  5373.  
  5374. DeviceKeyStateNotify
  5375.   1  CARD8         code
  5376.   1  CARD8         device id
  5377.      #x80         MORE_EVENTS follow
  5378.   2  CARD16         sequence number
  5379.   28 LISTofCARD8     state of keys 33-255
  5380.  
  5381.  
  5382.  
  5383. DeviceButtonStateNotify
  5384.   1  CARD8         code
  5385.   1  CARD8         device id
  5386.      #x80         MORE_EVENTS follow
  5387.   2  CARD16         sequence number
  5388.   28 LISTofCARD8     state of buttons 33-255
  5389.  
  5390.  
  5391.  
  5392. DeviceValuator
  5393.   1  CARD8         code
  5394.   1  CARD8         device id
  5395.   2  CARD16         sequence number
  5396.   2  SETofKEYBUTMASK     state
  5397.   1  n             number of valuators this device reports
  5398.   1  n             number of first valuator in this event
  5399.   24 LISTofINT32     valuators
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.  
  5407.  
  5408.  
  5409.  
  5410.                  79
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416. X Input Extension Protocol Specification    X11, Release 6.4
  5417.  
  5418.  
  5419. DeviceMappingNotify
  5420.   1  CARD8         code
  5421.   1  CARD8         device id
  5422.   2  CARD16         sequence number
  5423.   1             request
  5424.      0           MappingModifier
  5425.      1           MappingKeyboard
  5426.      2           MappingPointer
  5427.   1  KEYCODE         first-keycode
  5428.   1  CARD8         count
  5429.   1             unused
  5430.   4  TIMESTAMP         time
  5431.   20             unused
  5432.  
  5433.  
  5434.  
  5435. ChangeDeviceNotify
  5436.   1  CARD8         code
  5437.   1  CARD8         id of device specified on change request
  5438.   2  CARD16         sequence number
  5439.   4  TIMESTAMP         time
  5440.   1             request
  5441.      0           NewPointer
  5442.      1           NewKeyboard
  5443.   23             unused
  5444.  
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.  
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.  
  5465.  
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  
  5475.  
  5476.                  80
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.              Table of Contents
  5486.  
  5487.  
  5488. 1.1. Input Extension Overview  . . . . . . . . . . . . .   1
  5489. 1.2. Design Approach . . . . . . . . . . . . . . . . . .   1
  5490. 1.3. Core Input Devices  . . . . . . . . . . . . . . . .   1
  5491. 1.4. Extension Input Devices . . . . . . . . . . . . . .   2
  5492. 1.4.1. Event Classes . . . . . . . . . . . . . . . . . .   3
  5493. 1.4.2. Input Classes . . . . . . . . . . . . . . . . . .   3
  5494. 2. Requests  . . . . . . . . . . . . . . . . . . . . . .   4
  5495. 2.1. Getting the Extension Version . . . . . . . . . . .   4
  5496. 2.2. Listing Available Devices . . . . . . . . . . . . .   4
  5497. 2.3. Enabling Devices  . . . . . . . . . . . . . . . . .   8
  5498. 2.4. Changing The Mode Of A Device . . . . . . . . . . .   9
  5499. 2.5. Initializing Valuators on an Input Device . . . . .  10
  5500. 2.6. Getting Input Device Controls . . . . . . . . . . .  10
  5501. 2.7. Selecting Extension Device Events . . . . . . . . .  13
  5502. 2.8. Determining Selected Events . . . . . . . . . . . .  14
  5503. 2.9. Controlling Event Propagation . . . . . . . . . . .  14
  5504. 2.10. Sending Extension Events . . . . . . . . . . . . .  15
  5505. 2.11. Getting Motion History . . . . . . . . . . . . . .  16
  5506. 2.12. Changing The Core Devices  . . . . . . . . . . . .  16
  5507. 2.13. Event Synchronization And Core Grabs . . . . . . .  19
  5508. 2.14. Extension Active Grabs . . . . . . . . . . . . . .  19
  5509. 2.15. Passively Grabbing A Key . . . . . . . . . . . . .  21
  5510. 2.16. Passively Grabbing A Button  . . . . . . . . . . .  23
  5511. 2.17. Thawing A Device . . . . . . . . . . . . . . . . .  25
  5512. 2.18. Controlling Device Focus . . . . . . . . . . . . .  27
  5513. 2.19. Controlling Device Feedback  . . . . . . . . . . .  29
  5514. 2.20. Ringing a Bell on an Input Device  . . . . . . . .  34
  5515. 2.21. Controlling Device Encoding  . . . . . . . . . . .  34
  5516. 2.22. Controlling Button Mapping . . . . . . . . . . . .  38
  5517. 2.23. Obtaining The State Of A Device  . . . . . . . . .  39
  5518. 3. Events  . . . . . . . . . . . . . . . . . . . . . . .  40
  5519. 3.1. Button, Key, and Motion Events  . . . . . . . . . .  40
  5520. 3.2. DeviceValuator Event  . . . . . . . . . . . . . . .  41
  5521. 3.3. Device Focus Events . . . . . . . . . . . . . . . .  42
  5522. 3.4. Device State Notify Event . . . . . . . . . . . . .  42
  5523. 3.5. Device KeyState and ButtonState Notify Events
  5524.  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  43
  5525. 3.6. DeviceMappingNotify Event . . . . . . . . . . . . .  44
  5526. 3.7. ChangeDeviceNotify Event  . . . . . . . . . . . . .  44
  5527. 3.8. Proximity Events  . . . . . . . . . . . . . . . . .  44
  5528. Appendix A - Input Extension Protocol Encoding . . . . .  46
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.                   i
  5543.  
  5544.  
  5545.