home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / doc / extensions / xinput / protocol.ms < prev    next >
Encoding:
Text File  |  1991-07-28  |  89.7 KB  |  3,112 lines

  1. .\" Input Extension
  2. .EH ''''
  3. .OH ''''
  4. .EF ''''
  5. .OF ''''
  6. .ps 11
  7. .nr PS 11
  8. \0
  9. .sp 10
  10. .ce 500
  11. .ps 20
  12. \fBX11 Input Extension Protocol Specification
  13. .ps 12
  14. .sp 2
  15. Version 1.0
  16. .sp 1
  17. MIT X Consortium Standard
  18. .sp 1
  19. X Version 11, Release 5
  20. .sp 16
  21. .ps 15
  22. \fBMark Patrick\0\0\0\0Ardent Computer
  23. .sp 1
  24. \fBGeorge Sachs\0\0\0\0Hewlett-Packard
  25. .ps 12
  26. .ce 0
  27. .bp
  28. \0
  29. .sp 34 
  30. .fi
  31. \fB\s14\&Notice\fR\s9
  32. .vs 11
  33. .LP
  34. Copyright \(co 1989, 1990, 1991 by Hewlett-Packard Company, Ardent Computer, 
  35. and the Massachusetts Institute of Technology.
  36. .LP
  37. Permission to use, copy, modify, and distribute this documentation for
  38. any purpose and without fee is hereby granted, provided that the above
  39. copyright notice and this permission notice appear in all copies.
  40. MIT, Ardent, and Hewlett-Packard make no representations about the suitability 
  41. for any purpose of the information in this document.  It is provided "as is" 
  42. without express or implied warranty.
  43. .ps
  44. .vs
  45. .bp 1
  46. .EH '\fBX Input Extension Protocol Specification\fP''\fBX11, Release 5\fP'
  47. .OH '\fBX Input Extension Protocol Specification\fP''\fBX11, Release 5\fP'
  48. .EF ''\fB % \fP''
  49. .OF ''\fB % \fP''
  50. .\"  Force the heading counter for level 1 to one
  51. .\"
  52. .nr Ej 1
  53. .\"
  54. .\"
  55. .\"  Print table of contents to level 4 headings
  56. .\"
  57. .nr Cl 4
  58. .\"
  59. .\"  Page eject for each level 1 heading
  60. .\"
  61. .nr H1 1
  62. .nr P 1
  63. .\"
  64. .\"  Define Ch to contain the chapter string.
  65. .\"
  66. .ds Ch Input Extension Overview
  67. .\"
  68. .\"
  69. .\"  Pull in the layout macro package.
  70. .\"
  71. .\"
  72. .tr ~
  73. .NH 2
  74. Input Extension Overview
  75. .XS
  76. \*(SN Input Extension Overview
  77. .XE
  78. .LP
  79. This document defines an extension to the X11 protocol to support 
  80. input devices other than the core X keyboard and pointer. 
  81. An accompanying document defines a corresponding extension to Xlib 
  82. (similar extensions for languages other than C are anticipated).
  83. This first section gives an overview of the input extension.  The 
  84. next section defines the new protocol requests defined by the extension.
  85. We conclude with a description of the new input events generated by
  86. the additional input devices.
  87. .NH 2
  88. Design Approach
  89. .XS
  90. \*(SN Design Approach
  91. .XE
  92. .LP
  93. The design approach of the extension is to define requests
  94. and events analogous to the core requests and events. This allows
  95. extension input devices to be individually distinguishable from each other 
  96. and from the core input devices.  These requests and events make use
  97. of a device identifier and support the reporting of n-dimensional motion 
  98. data as well as other data that is not reportable via the core 
  99. input events.
  100. .NH 2
  101. Core Input Devices
  102. .XS
  103. \*(SN Core Input Devices
  104. .XE
  105. .LP
  106. The X server core protocol supports two input devices:  a pointer and a
  107. keyboard.  The pointer device has two major functions. 
  108. First, it may be used to generate motion information
  109. that client programs can detect. Second, it may also be used to indicate the
  110. current location and focus of the X keyboard.  To accomplish this, the server 
  111. echoes a cursor at the current position of the X pointer.  Unless the X
  112. keyboard has been explicitly focused, this cursor also shows the current
  113. location and focus of the X keyboard.
  114. .LP
  115. The X keyboard is used to generate input that client programs can detect.
  116. .LP
  117. The X keyboard and X pointer are referred to in this document as 
  118. the \fIcore devices\fP, and the input
  119. events they generate (\fBKeyPress\fP, \fBKeyRelease\fP, \fBButtonPress\fP, 
  120. \fBButtonRelease\fP, and
  121. \fBMotionNotify\fP) are known as the \fIcore input events\fP.  All other
  122. input devices are referred to as \fIextension input devices\fP and the 
  123. input events they generate are referred to as \fIextension input events\fP.
  124. .NT
  125. This input extension does not change the behavior or functionality of the
  126. core input devices, core events, or core protocol requests, with the
  127. exception of the core grab requests.  These requests may affect the
  128. synchronization of events from extension devices.  See the explanation
  129. in the section titled "Event Synchronization and Core Grabs".
  130. .NE
  131. .LP
  132. Selection of the physical devices to be initially used by the server as the 
  133. core devices is left implementation-dependent.  Requests are defined that
  134. allow client programs to change which physical devices are used as the
  135. core devices.
  136. .NH 2
  137. Extension Input Devices
  138. .XS
  139. \*(SN Extension Input Devices
  140. .XE
  141. .LP
  142. The input extension controls access to input devices other than the X keyboard
  143. and X pointer.  It allows client programs to select input from these devices 
  144. independently from each other and independently from the core devices.  
  145. .LP
  146. A client that wishes to access a specific device must first determine
  147. whether that device is connected to the X server.  This is done through the
  148. \fBListInputDevices\fP request, which will return a list of all devices that
  149. can be opened by the X server.  A client can then open one or more of these
  150. devices using the \fBOpenDevice\fP request, specify what events they are
  151. interested in receiving, and receive and process input events from extension
  152. devices in the same way as events from the X keyboard and X pointer.
  153. Input events from these devices are of extension types (\fBDeviceKeyPress\fP, 
  154. \fBDeviceKeyRelease\fP, \fBDeviceButtonPress\fP, \fBDeviceButtonRelease\fP, 
  155. \fBDeviceMotionNotify\fP, etc.) and contain a device identifier so that events 
  156. of the same type coming from different input devices can be distinguished.
  157. .LP
  158. Any kind of input device may be used as an extension input device.
  159. Extension input devices may have 0 or more keys, 0 or more buttons,
  160. and may report 0 or more axes of motion.  Motion may be reported 
  161. as relative movements from a previous position or as an absolute
  162. position.  All valuators reporting motion information for a given
  163. extension input device must report the same kind of motion information
  164. (absolute or relative).
  165. .LP
  166. This extension is designed to accommodate new types of input devices that
  167. may be added in the future.  The protocol requests that refer to
  168. specific characteristics of input devices organize that information
  169. by \fBinput classes\fP.  Server implementors may add new
  170. classes of input devices without changing the protocol requests.
  171. Input classes are unique numbers registered with the X Consortium.
  172. Each extension input device may support multiple input classes.
  173. .LP
  174. All extension input devices are treated like the core X keyboard in 
  175. determining their location and focus.  The server does not track the 
  176. location of these devices on an individual basis, and therefore
  177. does not echo a cursor to indicate their current location.
  178. Instead, their location is determined by the location of the core X pointer.
  179. Like the core X keyboard, some may be explicitly focused. If they are
  180. not explicitly focused,  their focus is determined by the location of the 
  181. core X pointer.
  182. .LP
  183. Input events reported by the server to a client are of fixed size (32 bytes).
  184. In order to represent the change in state of an input device the extension
  185. may need to generate a sequence of input events.  A client side library
  186. (such as Xlib) will typically take these raw input events and format
  187. them into a form more convenient to the client. 
  188. .NH 3
  189. Event Classes
  190. .XS
  191. \*(SN Event Classes
  192. .XE
  193. .LP
  194. In the core protocol a client registers interest in receiving certain
  195. input events directed to a window by modifying that window's event-mask.
  196. Most of the bits in the event mask are already used to specify interest
  197. in core X events.  The input extension specifies a different mechanism by which
  198. a client can express interest in events generated by this extension.
  199. .LP
  200. When a client opens a extension input device via the \fBOpenDevice\fP request, 
  201. an \fBXDevice\fP structure is returned.  Macros are provided that extract 
  202. 32-bit numbers called \fBevent classes\fP from that structure, that a client 
  203. can use to register interest in extension events via the 
  204. \fBSelectExtensionEvent\fP request.  The event class combines the desired 
  205. event type and device id, and may be thought of as the equivalent of core
  206. event masks.
  207. .NH 3
  208. Input Classes
  209. .XS
  210. \*(SN Input Classes
  211. .XE
  212. .LP
  213. Some of the input extension requests divide input devices into classes
  214. based on their functionality.  This is intended to allow new classes of input
  215. devices to be defined at a later time without changing the semantics of 
  216. these requests.  The following input device classes are currently
  217. defined:
  218. .RS
  219. .in +5n
  220. .IP "\fBKEY\fP"
  221. The device reports key events.
  222. .IP "\fBBUTTON\fP"
  223. The device reports button events.
  224. .IP "\fBVALUATOR\fP"
  225. The device reports valuator data in motion events.
  226. .IP "\fBPROXIMITY\fP"
  227. The device reports proximity events.
  228. .IP "\fBFOCUS\fP"
  229. The device can be focused and reports focus events.
  230. .IP "\fBFEEDBACK\fP"
  231. The device supports feedbacks.
  232. .IP "\fBOTHER\fP"
  233. The \fBChangeDeviceNotify\fP, \fBDeviceMappingNotify\fP, and 
  234. \fBDeviceStateNotify\fP macros may be invoked passing the \fBXDevice\fP 
  235. structure returned for this device.
  236. .in -5n
  237. .RE
  238. .LP
  239. Each extension input device may support multiple input classes.
  240. Additional classes may be added in the future.
  241. Requests that support multiple input classes, such as the 
  242. \fBListInputDevices\fP function that lists all available input devices,
  243. organize the data they return by input class.  Client programs that
  244. use these requests should not access data unless it matches a 
  245. class defined at the time those clients were compiled.  In this way,
  246. new classes can be added without forcing existing clients that use
  247. these requests to be recompiled.
  248. .NH 1
  249. Requests
  250. .XS
  251. \*(SN Requests
  252. .XE
  253. .LP
  254. Extension input devices are accessed by client programs through the 
  255. use of new protocol requests.  This section summarizes the new requests
  256. defined by this extension.  The syntax and type definitions used below 
  257. follow the notation used for the X11 core protocol.  
  258. .NH 2
  259. Getting the Extension Version
  260. .XS
  261. \*(SN Getting the Extension Version
  262. .XE
  263. .LP
  264. The \fBGetExtensionVersion\fP request returns version information about 
  265. the input extension.
  266. .sp 1.5
  267. GetExtensionVersion
  268. .in +.5i
  269. name: STRING
  270. .in -.5i
  271. =>
  272. .in +.5i
  273. .br
  274. present: BOOL
  275. .br
  276. protocol-major-version: CARD16
  277. .br
  278. protocol-minor-version: CARD16
  279. .br
  280. .sp
  281. The protocol version numbers returned indicate the version of the input
  282. extension supported by the target X server.  The version numbers can be 
  283. compared to constants defined in the header file \fBXI.h\fP.  Each version is
  284. a superset of the previous versions.
  285. .NH 2
  286. Listing Available Devices
  287. .XS
  288. \*(SN Listing Available Devices
  289. .XE
  290. .LP
  291. A client that wishes to access a specific device must first determine 
  292. whether that device is connected to the X server.  This is done through the
  293. \fBListInputDevices\fP request, which will return a list of all devices that
  294. can be opened by the X server.
  295. .sp 1.5
  296. ListInputDevices
  297. .in -.5i
  298. =>
  299. .in +.5i
  300. .br
  301. input-devices: LISTofDEVICEINFO
  302. .br
  303. .sp
  304. .in -.5i
  305. where
  306. .in +.5i
  307. .br
  308. .TS
  309. l lw(4i).
  310. T{
  311. DEVICEINFO:
  312. T}    T{
  313. [type: ATOM
  314. .br
  315. \ id: CARD8
  316. .br
  317. \ num_classes: CARD8
  318. .br
  319. \ use: {IsXKeyboard, IsXPointer, IsExtensionDevice}
  320. .br
  321. \ info: LISTofINPUTINFO
  322. .br
  323. \ name: STRING8]
  324. T}
  325. .sp
  326. T{
  327. INPUTINFO:
  328. T}    T{
  329. {KEYINFO, BUTTONINFO, VALUATORINFO}
  330. T}
  331. .sp
  332. T{
  333. KEYINFO:
  334. T}    T{
  335. [class: CARD8
  336. .br
  337. \ length: CARD8
  338. .br
  339. \ min-keycode: KEYCODE
  340. .br
  341. \ max-keycode: KEYCODE
  342. .br
  343. \ num-keys: CARD16]
  344. T}
  345. .sp
  346. T{
  347. BUTTONINFO:
  348. T}    T{
  349. .br
  350. [class: CARD8
  351. .br
  352. \ length: CARD8
  353. .br
  354. \ num-buttons: CARD16]
  355. T}
  356. .sp
  357. T{
  358. VALUATORINFO:
  359. T}    T{
  360. [class: CARD8
  361. .br
  362. \ length: CARD8
  363. .br
  364. \ num_axes: CARD8
  365. .br
  366. \ mode: SETofDEVICEMODE
  367. .br
  368. \ motion_buffer_size: CARD32
  369. .br
  370. \ axes: LISTofAXISINFO]
  371. T}
  372. .sp
  373. T{
  374. AXISINFO:
  375. T}    T{
  376. [resolution: CARD32
  377. .br
  378. \ min-val: CARD32
  379. .br
  380. \ max-val: CARD32]
  381. T}
  382. .sp
  383. T{
  384. DEVICEMODE:
  385. T}    T{
  386. {Absolute, Relative}
  387. T}
  388. .TE
  389. .br
  390. Errors: None
  391. .in -.5i
  392. .sp 1.5
  393. This request returns a list of all devices that can be opened by the X 
  394. server,  
  395. including the core X keyboard and X pointer.  Some implementations may open
  396. all input devices as part of X initialization, while others may not open
  397. an input device until requested to do so by a client program.
  398. .LP
  399. .IP \(bu 3n
  400. The information returned for each device is as follows:
  401. .LP
  402. The \fBtype\fP field is of type \fBAtom\fP and indicates the nature of the 
  403. device.  Clients may determine device types by invoking the \fBXInternAtom\fP
  404. request passing one of the names defined in the header file \fBXI.h\fP.  The
  405. following names have been defined to date:
  406. .DS
  407. \fBMOUSE\fP    
  408. \fBTABLET\fP
  409. \fBKEYBOARD\fP    
  410. \fBTOUCHSCREEN\fP
  411. \fBTOUCHPAD\fP    
  412. \fBBUTTONBOX\fP    
  413. \fBBARCODE\fP
  414. \fBKNOB_BOX\fP
  415. \fBTRACKBALL\fP    
  416. \fBQUADRATURE\fP
  417. \fBSPACEBALL\fP
  418. \fBDATAGLOVE\fP
  419. \fBEYETRACKER\fP
  420. \fBCURSORKEYS\fP
  421. \fBFOOTMOUSE\fP
  422. \fBID_MODULE\fP
  423. \fBONE_KNOB\fP
  424. \fBNINE_KNOB\fP
  425. .DE
  426. .LP
  427. The \fBid\fP is a small cardinal value in the range 0-128 that uniquely 
  428. identifies the device.  It is assigned to the device when it is initialized by 
  429. the server.  Some implementations may not open an input device until requested
  430. by a client program, and may close the device when the last client accessing
  431. it requests that it be closed.
  432. If a device is opened by a client program via \fBXOpenDevice\fP,
  433. then closed via \fBXCloseDevice\fP, then opened again, it is not guaranteed
  434. to have the same id after the second open request.
  435. .LP
  436. The \fBnum_classes\fP field is a small cardinal value in the range 0-255
  437. that specifies the number of input classes supported by the device for
  438. which information is returned by \fBListInputDevices\fP.  Some input classes,
  439. such as class \fBFocus\fP and class \fBProximity\fP do not have any information
  440. to be returned by \fBListInputDevices\fP.
  441. .LP
  442. The \fBuse\fP field specifies how the device is currently being used.  If the
  443. value is \fBIsXKeyboard\fP, the device is currently being used as the 
  444. X keyboard.  If the value is \fBIsXPointer\fP, the device is currently
  445. being used as the X pointer.  If the value is \fBIsXExtensionDevice\fP,
  446. the device is available for use as an extension device.
  447. .LP
  448. The \fBname\fP field contains a pointer to a null-terminated string that
  449. corresponds to one of the defined device types.
  450. .IP \(bu 3n
  451. \fBInputInfo\fP is one of: \fBKeyInfo\fP, \fBButtonInfo\fP or 
  452. \fBValuatorInfo\fP.  The first two fields are common to all three:
  453. .LP
  454. The \fBclass\fP field is a cardinal value in the range 0-255.  It uniquely
  455. identifies the class of input for which information is returned.
  456. .LP
  457. The \fBlength\fP field is a cardinal value in the range 0-255.  It specifies
  458. the number of bytes of data that are contained in this input class.  The
  459. length includes the class and length fields.
  460. .LP
  461. The remaining information returned for input class \fBKEYCLASS\fP is as follows:
  462. .LP
  463. \fBmin_keycode\fP is of type KEYCODE.  It specifies the minimum keycode that
  464. the device will report.  The minimum keycode will not be smaller than 8.
  465. .LP
  466. \fBmax_keycode\fP is of type KEYCODE.  It specifies the maximum keycode that
  467. the device will report.  The maximum keycode will not be larger than 255.
  468. .LP
  469. \fBnum_keys\fP is a cardinal value that specifies the number of keys that the
  470. device has.
  471. .LP
  472. The remaining information returned for input class \fBBUTTONCLASS\fP is as 
  473. follows:
  474. .LP
  475. \fBnum_buttons\fP is a cardinal value that specifies the number of buttons 
  476. that the device has.
  477. .LP
  478. The remaining information returned for input class \fBVALUATORCLASS\fP is as 
  479. follows:
  480. .LP
  481. \fBmode\fP is a constant that has one of the following values: \fBAbsolute\fP
  482. or \fBRelative\fP.  Some devices allow the mode to be changed dynamically
  483. via the \fBSetDeviceMode\fP request.
  484. .LP
  485. \fBmotion_buffer_size\fP is a cardinal number that specifies the number of 
  486. elements that can be contained in the motion history buffer for the device.
  487. .LP
  488. The \fBaxes\fP field contains a pointer to an AXISINFO struture.
  489. .IP \(bu 3n
  490. The information returned for each axis reported by the device is:
  491. .LP
  492. The \fBresolution\fP is a cardinal value in counts/meter.
  493. .LP
  494. The \fBmin_val\fP field is a cardinal value in that contains the minimum
  495. value the device reports for this axis.  For devices whose mode is 
  496. \fBRelative\fP, the min_val field will contain 0.
  497. .LP
  498. The \fBmax_val\fP field is a cardinal value in that contains the maximum
  499. value the device reports for this axis.  For devices whose mode is 
  500. \fBRelative\fP, the max_val field will contain 0.
  501. .NH 2
  502. Enabling Devices
  503. .XS
  504. \*(SN Enabling Devices
  505. .XE
  506. .LP
  507. Client programs that wish to access an extension device must request that
  508. the server open that device.  This is done via the \fBOpenDevice\fP
  509. request.  
  510. .sp 1.5
  511. OpenDevice
  512. .in +.5i
  513. id: CARD8
  514. .in -.5i
  515. =>
  516. .in +.5i
  517. .br
  518. .TS
  519. l lw(4i).
  520. T{
  521. DEVICE:
  522. T}    T{
  523. [device_id: XID
  524. .br
  525. \ num_classes: INT32
  526. .br
  527. \ classes: LISTofINPUTCLASSINFO]
  528. T}
  529. .sp
  530. T{
  531. INPUTCLASSINFO:
  532. T}    T{
  533. [input_class: CARD8
  534. .br
  535. \ event_type_base: CARD8]
  536. T}
  537. .TE
  538. .sp
  539. Errors: Device
  540. .in -.5i
  541. .sp 1.5
  542. .LP
  543. This request returns the event classes to be used by the client to indicate 
  544. which events the client program wishes to receive.  Each input class
  545. may report several event classes.  For example, input class \fBKeys\fP reports
  546. \fBDeviceKeyPress\fP and \fBDeviceKeyRelease\fP event classes.  Input classes 
  547. are unique numbers registered with the X Consortium.  Input class 
  548. \fBOther\fP exists
  549. to report event classes that are not specific to any one input class,
  550. such as \fBDeviceMappingNotify\fP, \fBChangeDeviceNotify\fP, and 
  551. \fBDeviceStateNotify\fP.
  552. .LP
  553. .IP \(bu 3n
  554. The information returned for each device is as follows:
  555. .LP
  556. The \fBdevice_id\fP is a number that uniquely identifies the device.
  557. .LP
  558. The \fBnum_classes\fP field contains the number of input classes supported
  559. by this device.
  560. .LP
  561. .IP \(bu 3n
  562. For each class of input supported by the device,
  563. the \fBInputClassInfo\fP structure contains the following information:
  564. .LP
  565. The \fBinput_class\fP is a small cardinal number that identifies the class
  566. of input.
  567. .LP
  568. The \fBevent_type_base\fP is a small cardinal number that specifies the 
  569. event type of one of the events reported by this input class.  This information
  570. is not directly used by client programs.  Instead, the \fBDevice\fP is used
  571. by macros that return extension event types and event classes.  This is 
  572. described in the section of this document entitled "Selecting Extension
  573. Device Events".
  574. .LP
  575. Before it exits,
  576. the client program should explicitly request that the server close
  577. the device.  This is done via the \fBCloseDevice\fP request.
  578. .LP
  579. A client may open the same extension device more than once.  Requests
  580. after the first successful one return an additional \fBXDevice\fP structure
  581. with the same information as the first, but otherwise have no effect.
  582. A single \fBCloseDevice\fP request will terminate that client's access to
  583. the device.
  584. .LP
  585. Closing a device releases any active or passive grabs the requesting client
  586. has established.  If the device is frozen only by an active grab of the
  587. requesting client, the queued events are released when the client terminates.
  588. .LP
  589. If a client program terminates without closing a device, the server will
  590. automatically close that device on behalf of the client.  This does not
  591. affect any other clients that may be accessing that device.
  592. .LP
  593. .sp 1.5
  594. CloseDevice
  595. .in +.5i
  596. device: DEVICE
  597. .br
  598. .sp
  599. Errors: Device
  600. .br
  601. .in -.5i
  602. .sp 1.5
  603. .NH 2
  604. Changing The Mode Of A Device
  605. .XS
  606. \*(SN Changing The Mode Of A Device
  607. .XE
  608. .LP
  609. Some devices are capable of reporting either relative or absolute motion
  610. data.  To change the mode of a device from relative to absolute, use the
  611. \fBSetDeviceMode\fP request.  The valid values are \fBAbsolute\fP or 
  612. \fBRelative\fP.
  613. .LP
  614. This request will fail and return \fBDeviceBusy\fP if another client already
  615. has the device open with a different mode.   It will fail and return 
  616. \fBAlreadyGrabbed\fP if another client has the device grabbed.
  617. The request will fail with
  618. a \fBBadMatch\fP error if the requested mode is not supported by the device.
  619. .sp 1.5
  620. SetDeviceMode
  621. .in +.5i
  622. device: DEVICE 
  623. .br
  624. mode: {Absolute, Relative}
  625. .br
  626. .sp
  627. Errors: Device, Match, Mode
  628. .br
  629. .in -.5i
  630. .sp 1.5
  631. =>
  632. .in +.5i
  633. status: {Success, DeviceBusy, AlreadyGrabbed}
  634. .br
  635. .sp
  636. .in -.5i
  637. .NH 2
  638. Initializing Valuators on an Input Device
  639. .XS
  640. \*(SN Initializing Valuators on an Input Device
  641. .XE
  642. .LP
  643. Some devices that report absolute positional data can be initialized to a 
  644. starting value.  Devices that are capable of reporting relative motion or
  645. absolute positional data may require that their valuators be initialized 
  646. to a starting value after the mode of the device is changed to \fBAbsolute\fP.
  647. To initialize the valuators on such a device, use the \fBSetDeviceValuators\fP
  648. request.
  649. .sp 1.5
  650. SetDeviceValuators
  651. .in .5i
  652. device: DEVICE
  653. .br
  654. first_valuator: CARD8
  655. .br
  656. num_valuators: CARD8
  657. .br
  658. valuators: LISTOFINT32
  659. .br
  660. .sp
  661. Errors: Length, Device, Match, Value
  662. .br
  663. .in -.5i
  664. .sp 1.5
  665. =>
  666. .in +.5i
  667. status: {Success, AlreadyGrabbed}
  668. .br
  669. .sp
  670. .in -.5i
  671. .LP
  672. This request initializes the specified valuators on the specified extension
  673. input device.  Valuators are numbered beginning with zero.  Only the valuators
  674. in the range specified by first_valuator and num_valuators are set.  If the
  675. number of valuators supported by the device is less than the expression
  676. first_valuator + num_valuators, a \fBValue\fP error will result.
  677. .LP
  678. If the request succeeds, \fBSuccess\fP is returned.  If the specifed device is 
  679. grabbed by some other client, the request will fail and a status of
  680. \fBAlreadyGrabbed\fP will be returned.
  681. .NH 2 
  682. Getting Input Device Controls
  683. .XS
  684. \*(SN Getting Input Device Controls
  685. .XE
  686. .LP
  687. .sp 1.5
  688. GetDeviceControl
  689. .in .5i
  690. device: DEVICE
  691. .br
  692. control: XID
  693. .br
  694. .sp
  695. Errors: Length, Device, Match, Value
  696. .br
  697. .in -.5i
  698. .sp 1.5
  699. =>
  700. .in +.5i
  701. controlState: {DeviceState}
  702. .br
  703. .sp
  704. .in -.5i
  705. .LP
  706. where
  707. .in +.5i
  708. .br
  709. .TS
  710. l lw(4i).
  711. T{
  712. DeviceState:
  713. T}    T{
  714. DeviceResolutionState
  715. T}
  716. .TE
  717. .in -.5i
  718. .br
  719. .sp
  720. Errors: Length, Device, Match, Value
  721. .LP
  722. This request returns the current state of the specified device control.
  723. The device control must be supported by the target server and device or an 
  724. error will result.  
  725. .LP
  726. If the request is successful, a pointer to a generic DeviceState 
  727. structure will be returned.  The information returned varies according to 
  728. the specified control and is mapped by a structure appropriate for that
  729. control.
  730. .LP
  731. GetDeviceControl will fail with a BadValue error if the server does not support
  732. the specified control.  It will fail with a BadMatch error if the device
  733. does not support the specified control.
  734. .LP
  735. Supported device controls and the information returned for them include:
  736. .LP
  737. .TS
  738. l lw(4i).
  739. T{
  740. DEVICE_RESOLUTION:
  741. T}    T{
  742. [control: CARD16
  743. .br
  744. \ length: CARD16
  745. .br
  746. \ num_valuators: CARD8
  747. .br
  748. \ resolutions: LISTofCARD32
  749. .br
  750. \ min_resolutions: LISTofCARD32
  751. .br
  752. \ max_resolutions: LISTofCARD32]
  753. T}
  754. .TE
  755. .LP
  756. This device control returns a list of valuators and the range of valid 
  757. resolutions allowed for each.  Valuators are numbered beginning with 0.
  758. Resolutions for all valuators on the device are returned.  
  759. For each valuator i on the device, resolutions[i] returns the current setting
  760. of the resolution, min_resolutions[i] returns the minimum valid setting,
  761. and max_resolutions[i] returns the maximum valid setting.
  762. .LP
  763. When this control is specified, XGetDeviceControl will fail with a BadMatch
  764. error if the specified device has no valuators.
  765. .sp 1.5
  766. ChangeDeviceControl
  767. .in .5i
  768. device: DEVICE
  769. .br
  770. XID: controlId
  771. .br
  772. control: DeviceControl
  773. .br
  774. .sp
  775. .in -.5i
  776. .LP
  777. where
  778. .in +.5i
  779. .br
  780. .TS
  781. l lw(4i).
  782. T{
  783. DeviceControl:
  784. T}    T{
  785. DeviceResolutionControl
  786. T}
  787. .TE
  788. .in -.5i
  789. .br
  790. .sp
  791. Errors: Length, Device, Match, Value
  792. .br
  793. =>
  794. .in +.5i
  795. status: {Success, DeviceBusy, AlreadyGrabbed}
  796. .br
  797. .sp
  798. .in -.5i
  799. .LP
  800. ChangeDeviceControl changes the specifed device control according to the values
  801. specified in the DeviceControl structure.  The device control must be supported
  802. by the target server and device or an error will result.
  803. .LP
  804. The information passed with this request varies according to the specified 
  805. control and is mapped by a structure appropriate for that control.
  806. .LP
  807. ChangeDeviceControl will fail with a BadValue error if the server does not 
  808. support the specified control.  It will fail with a BadMatch error if the 
  809. server supports the specified control, but the requested device does not.
  810. The request will fail and return a status of DeviceBusy if another client 
  811. already has the device open with a device control state that conflicts with
  812. the one specified in the request.  It will fail with a status of 
  813. AlreadyGrabbed if some other client has grabbed the specified device.  If 
  814. the request succeeds, Success is returned.  If it fails, the device control 
  815. is left unchanged.
  816. .LP
  817. Supported device controls and the information specified for them include:
  818. .LP
  819. .TS
  820. l lw(4i).
  821. T{
  822. DEVICE_RESOLUTION:
  823. T}    T{
  824. [control: CARD16
  825. .br
  826. \ length: CARD16
  827. .br
  828. \ first_valuator: CARD8
  829. .br
  830. \ num_valuators: CARD8
  831. .br
  832. \ resolutions: LISTofCARD32]
  833. T}
  834. .TE
  835. .LP
  836. This device control changes the resolution of the specified valuators
  837. on the specified extension input device.  Valuators are numbered beginning
  838. with zero.  Only the valuators in the range specified by first_valuator
  839. and num_valuators are set.  A value of -1 in the resolutions list indicates 
  840. that the resolution for this valuator is not to be changed.  num_valuators 
  841. specifies the number of valuators in the resolutions list.
  842. .LP
  843. When this control is specified, XChangeDeviceControl will fail with a BadMatch
  844. error if the specified device has no valuators.  If a resolution is specified
  845. that is not within the range of valid values (as returned by XGetDeviceControl)
  846. the request will fail with a BadValue error.  If the number of valuators
  847. supported by the device is less than the expression first_valuator + 
  848. num_valuators, a BadValue error will result.
  849. .LP
  850. If the request fails for any reason, none of the valuator resolutions will be 
  851. changed.
  852. .NH 2
  853. Selecting Extension Device Events
  854. .XS
  855. \*(SN Selecting Extension Device Events
  856. .XE
  857. .LP
  858. Extension input events are selected using the \fBSelectExtensionEvent\fP
  859. request.
  860. .sp 1.5
  861. SelectExtensionEvent
  862. .in .5i
  863. window: WINDOW
  864. .br
  865. interest: LISTofEVENTCLASS
  866. .br
  867. .sp
  868. Errors: Window, Class, Access
  869. .br
  870. .in -.5i
  871. .sp 1.5
  872. .LP
  873. This request specifies to the server the events within the specified window
  874. which are of interest to the client.  As with the core \fBXSelectInput\fP
  875. function, multiple clients can select input on the same window.
  876. .LP
  877. \fBXSelectExtensionEvent\fP requires a list of \fIevent classes\fP.
  878. An event class is a 32-bit number that combines an event type and
  879. device id, and is used to indicate which event a client wishes to 
  880. receive and from which device it wishes to receive it.  Macros
  881. are provided to obtain event classes from the data returned by
  882. the \fBXOpenDevice\fP request.  The names of these macros correspond
  883. to the desired events, i.e. the \fBDeviceKeyPress\fP is used to 
  884. obtain the event class for \fBDeviceKeyPress\fP events.  The syntax
  885. of the macro invocation is:
  886. .sp 1.5
  887. DeviceKeyPress (device, event_type, event_class);
  888. .in .5i
  889. device: DEVICE
  890. .br
  891. event_type: INT
  892. .br
  893. event_class: INT
  894. .in -.5i
  895. .br
  896. .LP
  897. The value returned in \fBevent_type\fP is the value that will be contained in
  898. the event type field of the \fBXDeviceKeyPressEvent\fP when it is received by 
  899. the client.  The value returned in \fBevent_class\fP is the value that should
  900. be passed in making an \fBXSelectExtensionEvent\fP request to receive
  901. \fBDeviceKeyPress\fP events.
  902. .LP
  903. For \fBDeviceButtonPress\fP events, the client may specify whether
  904. or not an implicit passive grab should be done when the button is
  905. pressed.  If the client wants to guarantee that it will receive
  906. a \fBDeviceButtonRelease\fP event for each \fBDeviceButtonPress\fP
  907. event it receives, it should specify the \fBDeviceButtonPressGrab\fP
  908. event class as well as the \fBDeviceButtonPress\fP event class.
  909. This restricts the client in that only one client at a time
  910. may request \fBDeviceButtonPress\fP events from the same device and
  911. window if any client specifies this class.
  912. .LP
  913. If any client has specified the \fBDeviceButtonPressGrab\fP class, any requests
  914. by any other client that specify the same device and window and specify
  915. \fBDeviceButtonPress\fP or \fBDeviceButtonPressGrab\fP will
  916. cause an \fBAccess\fP error to be generated.
  917. .LP
  918. If only the \fBDeviceButtonPress\fP class is specified, no implicit
  919. passive grab will be done when a button is pressed on the device.
  920. Multiple clients may use this class to specify the same device and
  921. window combination.
  922. .LP
  923. A client may also specify the \fBDeviceOwnerGrabButton\fP class.  If it has
  924. specified both the \fBDeviceButtonPressGrab\fP and the  
  925. \fBDeviceOwnerGrabButton\fP classes, implicit passive grabs will activate
  926. with owner_events set to \fBTrue\fP.  If only the 
  927. \fBDeviceButtonPressGrab\fP class is specified, implicit passive grabs will
  928. activate with owner_events set to \fBFalse\fP.
  929. .LP
  930. The client may select \fBDeviceMotion\fP events only when a 
  931. button is down.  It does this by specifying the event classes 
  932. \fBButton1Motion\fP through \fBButton5Motion\fP, or \fBButtonMotion\fP.  
  933. An input device will only support
  934. as many button motion classes as it has buttons.
  935. .NH 2
  936. Determining Selected Events
  937. .XS
  938. \*(SN Determining Selected Events
  939. .XE
  940. .LP
  941. To determine which extension events are currently selected from a given
  942. window, use \fBGetSelectedExtensionEvents\fP.
  943. .sp 1.5
  944. GetSelectedExtensionEvents 
  945. .in .5i
  946. window: WINDOW
  947. .br
  948. .in -.5i
  949. =>
  950. .in +.5i
  951. .br
  952. this-client: LISTofEVENTCLASS
  953. .br
  954. all-clients: LISTofEVENTCLASS
  955. .br
  956. .sp
  957. Errors: Window
  958. .br
  959. .in -.5i
  960. .sp 1.5
  961. .LP
  962. This request returns two lists specifying the events selected on the specified
  963. window.  One list gives the extension events selected by this client from
  964. the specified window.  The other list gives the extension events selected by
  965. all clients from the specified window.  This information is equivalent
  966. to that returned by your-event-mask and all-event-masks in a
  967. \fBGetWindowAttributes\fP request. 
  968. .NH 2
  969. Controlling Event Propagation
  970. .XS
  971. \*(SN Controlling Event Propagation
  972. .XE
  973. .LP
  974. Extension events propagate up the window hierarchy in the same manner
  975. as core events.  If a window is not interested in an extension event, 
  976. it usually propagates to the closest ancestor that is interested,
  977. unless the dont_propagate list prohibits it.
  978. Grabs of extension devices may alter the set of windows that receive a 
  979. particular extension event.
  980. .LP
  981. Client programs may control extension event propagation through the use
  982. of the following two requests.  
  983. .LP
  984. \fBXChangeDeviceDontPropagateList\fP adds an event to or deletes an event from 
  985. the do_not_propagate list of extension events for the specified window.  This
  986. list is maintained for the life of the window, and is not altered if the 
  987. client terminates.
  988. .LP
  989. .sp 1.5
  990. ChangeDeviceDontPropagateList
  991. .in .5i
  992. window: WINDOW
  993. .br
  994. eventclass: LISTofEVENTCLASS
  995. .br
  996. mode: {AddToList, DeleteFromList}
  997. .br
  998. .sp
  999. Errors: Window, Class, Mode
  1000. .br
  1001. .in -.5i
  1002. .sp 1.5
  1003. .LP
  1004. This function modifies the list specifying the events that are not propagated
  1005. to the ancestors of the specified window.  You may use the modes \fBAddToList\fP
  1006. or \fBDeleteFromList\fP.
  1007. .sp 1.5
  1008. GetDeviceDontPropagateList
  1009. .in .5i
  1010. window: WINDOW
  1011. .br
  1012. .sp
  1013. Errors: Window
  1014. .br
  1015. .in -.5i
  1016. =>
  1017. .in +.5i
  1018. dont-propagate-list: LISTofEVENTCLASS
  1019. .br
  1020. .sp
  1021. .in -.5i
  1022. .sp 1.5
  1023. .LP
  1024. This function returns a list specifying the events that are not propagated
  1025. to the ancestors of the specified window.
  1026. .NH 2
  1027. Sending Extension Events
  1028. .XS
  1029. \*(SN Sending Extension Events
  1030. .XE
  1031. .LP
  1032. One client program may send an event to another via the 
  1033. \fBXSendExtensionEvent\fP function.
  1034. .LP
  1035. The event in the \fBXEvent\fP structure must be one of the events defined
  1036. by the input extension, so that the X server can correctly byte swap the
  1037. contents as necessary.  The contents of the event are otherwise unaltered
  1038. and unchecked by the X server except to force send_event to \fBTrue\fP
  1039. in the forwarded event and to set the sequence number in the event correctly.
  1040. .LP
  1041. XSendExtensionEvent returns zero if the conversion-to-wire protocol
  1042. failed, otherwise it returns nonzero.
  1043. .sp 1.5
  1044. SendExtensionEvent
  1045. .in .5i
  1046. device: DEVICE
  1047. .br
  1048. destination: WINDOW
  1049. .br
  1050. propagate: BOOL
  1051. .br
  1052. eventclass: LISTofEVENTCLASS
  1053. .br
  1054. event: XEVENT
  1055. .in -.5i
  1056. .sp
  1057. .br
  1058. Errors: Device, Value, Class, Window
  1059. .NH 2
  1060. Getting Motion History
  1061. .XS
  1062. \*(SN Getting Motion History
  1063. .XE
  1064. .LP
  1065. .sp 1.5
  1066. GetDeviceMotionEvents 
  1067. .in .5i
  1068. device: DEVICE
  1069. .br
  1070. start, stop: TIMESTAMP or CurrentTime
  1071. .br
  1072. .in -.5i
  1073. =>
  1074. .br
  1075. .in +.5i
  1076. nevents_return: CARD32
  1077. .br
  1078. mode_return: {Absolute, Relative}
  1079. .br
  1080. axis_count_return: CARD8
  1081. .br
  1082. events: LISTofDEVICETIMECOORD
  1083. .br
  1084. .sp
  1085. .in -.5i
  1086. where
  1087. .br
  1088. .in +.5i
  1089. .TS
  1090. l lw(4i).
  1091. T{
  1092. DEVICETIMECOORD:
  1093. T}    T{
  1094. [data:LISTofINT32
  1095. \ time:TIMESTAMP]
  1096. T}
  1097. .TE
  1098. .sp
  1099. Errors: Device, Match, Window
  1100. .br
  1101. .in -.5i
  1102. .sp 1.5
  1103. .LP
  1104. This request returns all positions in the device's motion history buffer
  1105. that fall between the specified start and stop times inclusive.  If the
  1106. start time is in the future, or is later than the stop time, no positions
  1107. are returned.
  1108. .LP
  1109. The data field of the DEVICETIMECOORD structure is a sequence of 
  1110. data items.  Each item is of type INT32, and there is one data item
  1111. per axis of motion reported by the device.  
  1112. The number of axes reported
  1113. by the device is returned in the axis_count variable.
  1114. .LP
  1115. The value of the data items depends on the mode of the device, which
  1116. is returned in the mode variable.
  1117. If the mode is Absolute, the data items are the raw values 
  1118. generated by the device.  These may be scaled by the client program 
  1119. using the maximum values that the device can generate for each axis 
  1120. of motion that it reports.  The maximum and minimum values for each 
  1121. axis are reported by the \fBListInputDevices\fP request.
  1122. .LP
  1123. If the mode is Relative, the data items are the relative values
  1124. generated by the device.  The client program must choose an initial
  1125. position for the device and maintain a current position by 
  1126. accumulating these relative values.
  1127. .NH 2
  1128. Changing The Core Devices
  1129. .XS
  1130. \*(SN Changing The Core Devices
  1131. .XE
  1132. .LP
  1133. These requests are provided to change which physical device is used
  1134. as the X pointer or X keyboard.
  1135. .NT
  1136. Using these requests may change the characteristics of the core devices.
  1137. The new pointer device may have a different number of buttons than the 
  1138. old one did, or the new keyboard device may have a different number of
  1139. keys or report a different range of keycodes.  Client programs may be
  1140. running that depend on those characteristics.  For example, a client
  1141. program could allocate an array based on the number of buttons on the
  1142. pointer device, and then use the button numbers received in button events
  1143. as indicies into that array.  Changing the core devices could cause
  1144. such client programs to behave improperly or abnormally terminate.
  1145. .NE
  1146. .LP
  1147. These requests change the X keyboard or X pointer device and generate
  1148. an \fBChangeDeviceNotify\fP event and a \fBMappingNotify\fP event.  
  1149. The \fBChangeDeviceNotify\fP event is sent only to those clients that have 
  1150. expressed an interest in receiving that event via the 
  1151. \fBXSelectExtensionEvent\fP request.
  1152. The specified device becomes the
  1153. new X keyboard or X pointer device.  The location of the core device
  1154. does not change as a result of this request.
  1155. .LP
  1156. These requests fail and return \fBAlreadyGrabbed\fP if either the specified
  1157. device or the core device it would replace are grabbed by some other
  1158. client.  They fail and return \fBGrabFrozen\fP if either device is frozen
  1159. by the active grab of another client.
  1160. .LP
  1161. These requests fail with a \fBBadDevice\fP error if the specified device is
  1162. invalid, or has not previously been opened via \fBOpenDevice\fP.
  1163. .sp 2
  1164. To change the X keyboard device, use the \fBChangeKeyboardDevice\fP request.
  1165. The specified device must support input class Keys (as reported in the
  1166. ListInputDevices request) or the request will fail with a \fBBadMatch\fP error.
  1167. Once the device has successfully replaced one of the core devices, it
  1168. is treated as a core device until it is in turn replaced by another
  1169. ChangeDevice request, or until the server terminates.  The termination
  1170. of the client that changed  the device will not cause it to change back.
  1171. Attempts to use the CloseDevice request to close the new core device will
  1172. fail with a BadDevice error.
  1173. .LP
  1174. The focus state of the new keyboard is the same as the focus state of the old 
  1175. X keyboard.  If the new keyboard was not initialized with a \fBFocusRec\fP,
  1176. one is added by the \fBChangeKeyboardDevice\fP request.
  1177. .sp 1.5
  1178. ChangeKeyboardDevice 
  1179. .in .5i
  1180. device: DEVICE
  1181. .br
  1182. .sp
  1183. Errors: Device, Match
  1184. .br
  1185. .in -.5i
  1186. .sp 1.5
  1187. .LP
  1188. To change the X pointer device, use the \fBChangePointerDevice\fP request.
  1189. The specified device must support input class Valuators (as reported in the
  1190. ListInputDevices request) or the request will fail with a BadMatch error.
  1191. The valuators to be used as the x- and y-axes of the pointer device must
  1192. be specified.  Data from other valuators on the device will be ignored.
  1193. .LP
  1194. The X pointer device does not contain a \fBFocusRec\fP.  If the new
  1195. pointer was initialized with a \fBFocusRec\fP, it is freed by the 
  1196. \fBChangePointerDevice\fP request.
  1197. .LP
  1198. If the specified device reports absolute positional information, and the 
  1199. server implementation does not allow such a device to be used as the 
  1200. X pointer, the request will fail with a \fBBadDevice\fP error.
  1201. .LP
  1202. Once the device has successfully replaced one of the core devices, it
  1203. is treated as a core device until it is in turn replaced by another
  1204. ChangeDevice request, or until the server terminates.  The termination
  1205. of the client that changed  the device will not cause it to change back.
  1206. Attempts to use the CloseDevice request to close the new core device will
  1207. fail with a BadDevice error.
  1208. .sp 1.5
  1209. ChangePointerDevice 
  1210. .in .5i
  1211. device: DEVICE
  1212. .br
  1213. xaxis: CARD8
  1214. .br
  1215. yaxis: CARD8
  1216. .sp
  1217. Errors: Device, Match
  1218. .br
  1219. .in -.5i
  1220. .sp 1.5
  1221. .NH 2
  1222. Event Synchronization And Core Grabs
  1223. .XS
  1224. \*(SN Event Synchronization And Core Grabs
  1225. .XE
  1226. .LP
  1227. Implementation of the input extension requires an extension of the
  1228. meaning of event synchronization for the core grab requests.  This is
  1229. necessary in order to allow window managers to freeze all input devices
  1230. with a single request.
  1231. .LP
  1232. The core grab requests require a \fBpointer_mode\fP and \fBkeyboard_mode\fP
  1233. argument.  The meaning of these modes is changed by the input extension.
  1234. For the \fBXGrabPointer\fP and \fBXGrabButton\fP requests, \fBpointer_mode\fP
  1235. controls synchronization of the pointer device, and \fBkeyboard_mode\fP
  1236. controls the synchronization of all other input devices.  
  1237. For the \fBXGrabKeyboard\fP
  1238. and \fBXGrabKey\fP requests, \fBpointer_mode\fP controls the synchronization
  1239. of all input devices except the X keyboard, while \fBkeyboard_mode\fP controls
  1240. the synchronization of the keyboard.  When using one of the core grab
  1241. requests, the synchronization of extension devices
  1242. is controlled by the mode specified for the device not being grabbed.
  1243. .NH 2
  1244. Extension Active Grabs
  1245. .XS
  1246. \*(SN Extension Active Grabs
  1247. .XE
  1248. .LP
  1249. Active grabs of extension devices are supported via the \fBGrabDevice\fP
  1250. request in the same way that core devices are grabbed using the core 
  1251. GrabKeyboard request, except that a \fIDevice\fP is passed as
  1252. a function parameter.  A list of events that the client wishes to 
  1253. receive is also passed.  The \fBUngrabDevice\fP request allows a
  1254. previous active grab for an extension device to be released.
  1255. .LP
  1256. To grab an extension device, use the \fBGrabDevice\fP request.
  1257. The device must have previously been opened using the \fBOpenDevice\fP 
  1258. request.
  1259. .sp 1.5
  1260. GrabDevice 
  1261. .br
  1262. .in .5i
  1263. device: DEVICE
  1264. .br
  1265. grab-window: WINDOW
  1266. .br
  1267. owner-events: BOOL
  1268. .br
  1269. event-list: LISTofEVENTCLASS
  1270. .br
  1271. this-device-mode: {Synchronous, Asynchronous}
  1272. .br
  1273. other-device-mode: {Synchronous, Asynchronous}
  1274. .br
  1275. time:TIMESTAMP or CurrentTime
  1276. .br
  1277. .in -.5i
  1278. =>
  1279. .br
  1280. .in +.5i
  1281. status: Success, AlreadyGrabbed, Frozen, InvalidTime, NotViewable
  1282. .br
  1283. .sp
  1284. Errors:  Device, Window, Value
  1285. .br
  1286. .in -.5i
  1287. .sp 1.5
  1288. .LP
  1289. This request actively grabs control of the specified input device.  Further 
  1290. input events from this device are reported only to the grabbing client. 
  1291. This request overrides any previous active grab by this client for this
  1292. device.
  1293. .LP
  1294. The event-list parameter is a pointer to a list of event classes.  These
  1295. are used to indicate which events the client wishes to receive while the 
  1296. device is grabbed.  Only event classes obtained from the grabbed device
  1297. are valid.
  1298. .LP
  1299. If owner-events is \fBFalse\fP, input events generated from this 
  1300. device are reported with respect to grab-window, and are only reported if
  1301. selected by being included in the event-list.
  1302. If owner-events is 
  1303. \fBTrue\fP, then if a generated event would normally be reported to this 
  1304. client, it is reported normally, otherwise the event is reported with 
  1305. respect to the grab-window, and is only reported if selected by being
  1306. included in the event-list.  For either value of owner-events, unreported
  1307. events are discarded.
  1308. .LP
  1309. If this-device-mode is \fBAsynchronous\fP, device event processing continues 
  1310. normally.  If the device is currently frozen by this client, then processing 
  1311. of device events is resumed.  If this-device-mode is \fBSynchronous\fP, 
  1312. the state of the grabbed device (as seen by means of the protocol) appears 
  1313. to freeze,
  1314. and no further device events are generated by the server until the grabbing 
  1315. client issues a releasing \fBAllowDeviceEvents\fP request or until the device 
  1316. grab is released.  Actual device input events are not lost while the device 
  1317. is frozen; they are simply queued for later processing.
  1318. .LP
  1319. If other-device-mode is \fBAsynchronous\fP, event processing is 
  1320. unaffected by activation of the grab.  If other-device-mode is 
  1321. \fBSynchronous\fP, the state of all input devices except the grabbed one
  1322. (as seen by means of the protocol) appears to 
  1323. freeze, and no further events are generated by the server until 
  1324. the grabbing client issues a releasing \fBAllowDeviceEvents\fP request or 
  1325. until the device grab is released.  Actual events are not lost
  1326. while the devices are frozen; they are simply queued for later
  1327. processing.
  1328. .LP
  1329. This request generates \fBDeviceFocusIn\fP and \fBDeviceFocusOut\fP events.  
  1330. .LP
  1331. This request fails and returns:
  1332. .IP \(bu 3n
  1333. \fBAlreadyGrabbed\fP
  1334. If the device is actively grabbed by some other client.
  1335. .IP \(bu 3n
  1336. \fBNotViewable\fP
  1337. If grab-window is not viewable.
  1338. .IP \(bu 3n
  1339. \fBInvalidTime\fP
  1340. If the specified time is earlier
  1341. than the last-grab-time for the specified device
  1342. or later than the current X server time. Otherwise,
  1343. the last-grab-time for the specified device is set
  1344. to the specified time and 
  1345. \fBCurrentTime\fP
  1346. is replaced by the current X server time.
  1347. .IP \(bu 3n
  1348. \fBFrozen\fP
  1349. If the device is frozen by an active grab of another client.
  1350. .LP
  1351. If a grabbed device is closed by a client while an active grab by that 
  1352. client is in
  1353. effect, that active grab will be released.  Any passive grabs established by
  1354. that client will be released.  If the device is frozen only by an active grab
  1355. of the requesting client, it is thawed.
  1356. .LP
  1357. To release a grab of an extension device, use \fBUngrabDevice\fP.
  1358. .sp 1.5
  1359. UngrabDevice 
  1360. .br
  1361. .in .5i
  1362. device: DEVICE
  1363. .br
  1364. time: TIMESTAMP or CurrentTime
  1365. .br
  1366. .sp
  1367. Errors:  Device
  1368. .br
  1369. .in -.5i
  1370. .sp 1.5
  1371. .LP
  1372. This request releases the device if this client has it actively grabbed
  1373. (from either \fBGrabDevice\fP or \fBGrabDeviceKey\fP) and releases
  1374. any queued events.  If any devices were frozen by the grab,
  1375. \fBUngrabDevice\fP thaws them.
  1376. The request has no effect if the specified time is earlier 
  1377. than the last-device-grab time or is later than the current server time.  
  1378. .LP
  1379. This request generates \fBDeviceFocusIn\fP and \fBDeviceFocusOut\fP events.  
  1380. .LP
  1381. An \fBUngrabDevice\fP is performed automatically if the event window for an
  1382. active device grab becomes not viewable.
  1383. .NH 2
  1384. Passively Grabbing A Key
  1385. .XS
  1386. \*(SN Passively Grabbing A Key
  1387. .XE
  1388. .LP
  1389. Passive grabs of buttons and keys on extension devices are supported
  1390. via the \fBGrabDeviceButton\fP and \fBGrabDeviceKey\fP requests.
  1391. These passive grabs are released via the \fBUngrabDeviceKey\fP and
  1392. \fBUngrabDeviceButton\fP requests.
  1393. .LP
  1394. To passively grab a single key on an extension device, use \fBGrabDeviceKey\fP.
  1395. That device must have previously been opened using the \fBOpenDevice\fP 
  1396. request.
  1397. .sp 1.5
  1398. GrabDeviceKey 
  1399. .br
  1400. .LP
  1401. .in .5i
  1402. device: DEVICE
  1403. .br
  1404. keycode: KEYCODE or AnyKey
  1405. .br
  1406. modifiers: SETofKEYMASK or AnyModifier
  1407. .br
  1408. modifier-device: DEVICE or NULL
  1409. .br
  1410. grab-window: WINDOW
  1411. .br
  1412. owner-events: BOOL
  1413. .br
  1414. event-list: LISTofEVENTCLASS
  1415. .br
  1416. this-device-mode: {Synchronous, Asynchronous}
  1417. .br
  1418. other-device-mode: {Synchronous, Asynchronous}
  1419. .br
  1420. .sp
  1421. Errors:  Device, Match, Access, Window, Value
  1422. .br
  1423. .in -.5i
  1424. .sp 1.5
  1425. .LP
  1426. This request is analogous to the core \fBGrabKey\fP request.  It establishes a 
  1427. passive grab on a device.  Consequently, In the future:
  1428. .IP \(bu 3n
  1429. IF the device is not grabbed and the specified key, which itself can be a 
  1430. modifier key, is logically pressed when the specified modifier keys 
  1431. logically are down on the specified modifier device (and no other 
  1432. keys are down),
  1433. .IP \(bu 3n
  1434. AND no other modifier keys logically are down,
  1435. .IP \(bu 3n
  1436. AND EITHER the grab window is an ancestor of (or is) the focus window
  1437. OR the grab window is a descendent of the focus window and contains the pointer,
  1438. .IP \(bu 3n
  1439. AND a passive grab on the same device and key combination does not exist on any
  1440. ancestor of the grab window,
  1441. .IP \(bu 3n
  1442. THEN the device is actively grabbed, as for \fBGrabDevice\fP,
  1443. the last-device-grab time is set to the time at which the key was pressed
  1444. (as transmitted in the \fBDeviceKeyPress\fP event), and the 
  1445. \fBDeviceKeyPress\fP event is reported.
  1446. .LP
  1447. The interpretation of the remaining arguments is as for \fBGrabDevice\fP.
  1448. The active grab is terminated automatically when logical state of the
  1449. device has the specified key released (independent of the logical state of the 
  1450. modifier keys).
  1451. .LP
  1452. Note that the logical state of a device (as seen by means of the X protocol)
  1453. may lag the physical state if device event processing is frozen.
  1454. .LP
  1455. A modifier of \fBAnyModifier\fP is equivalent to issuing the request for all
  1456. possible modifier combinations (including the combination of no modifiers).  
  1457. It is not required that all modifiers specified have currently assigned 
  1458. keycodes.
  1459. A key of \fBAnyKey\fP is equivalent to issuing
  1460. the request for all possible keycodes.  Otherwise, the key must be in
  1461. the range specified by min-keycode and max-keycode in the \fBListInputDevices\fP
  1462. request.  If it is not within that range, \fBGrabDeviceKey\fP generates a
  1463. \fBValue\fP error.
  1464. .LP
  1465. \fBNULL\fP may be passed for the modifier_device.  If the modifier_device is
  1466. \fBNULL\fP, the core X keyboard is used as the modifier_device.
  1467. .LP
  1468. An \fBAccess\fP error is generated if some other client has issued a 
  1469. \fBGrabDeviceKey\fP with the same device and key combination on the 
  1470. same window.  When using \fBAnyModifier\fP or \fBAnyKey\fP,
  1471. the request fails completely and the X server generates a \fBAccess\fP
  1472. error and no grabs are established if there is a conflicting grab for any 
  1473. combination.
  1474. .LP
  1475. This request cannot be used to grab a key on the X keyboard device.  
  1476. The core \fBGrabKey\fP request should be used for that purpose.
  1477. .LP
  1478. To release a passive grab of a single key on an extension device, 
  1479. use \fBUngrabDeviceKey\fP.
  1480. .sp 1.5
  1481. UngrabDeviceKey
  1482. .LP
  1483. .in .5i
  1484. device: DEVICE
  1485. .br
  1486. keycode: KEYCODE or AnyKey
  1487. .br
  1488. modifiers: SETofKEYMASK or AnyModifier
  1489. .br
  1490. modifier-device: DEVICE or NULL
  1491. .br
  1492. grab-window: WINDOW
  1493. .br
  1494. .sp
  1495. Errors:  Device, Match, Window, Value, Alloc
  1496. .br
  1497. .in -.5i
  1498. .sp 1.5
  1499. .LP
  1500. This request is analogous to the core \fBUngrabKey\fP request.  It releases 
  1501. the key combination on the specified window if it was grabbed by this 
  1502. client.  A modifier of \fBAnyModifier\fP is equivalent to issuing the 
  1503. request for all possible modifier combinations (including the combination 
  1504. of no modifiers).  A key of \fBAnyKey\fP is equivalent to issuing the 
  1505. request for all possible keycodes.  This request has no effect on an 
  1506. active grab.
  1507. .LP
  1508. \fBNULL\fP may be passed for the modifier_device.  If the modifier_device is
  1509. \fBNULL\fP, the core X keyboard is used as the modifier_device.
  1510. .NH 2
  1511. Passively Grabbing A Button
  1512. .XS
  1513. \*(SN Passively Grabbing A Button
  1514. .XE
  1515. .LP
  1516. To establish a passive grab for a single button on an extension device,
  1517. use \fBGrabDeviceButton\fP.
  1518. .sp 1.5
  1519. GrabDeviceButton 
  1520. .LP
  1521. .in .5i
  1522. device: DEVICE
  1523. .br
  1524. button: BUTTON or AnyButton
  1525. .br
  1526. modifiers: SETofKEYMASK or AnyModifier
  1527. .br
  1528. modifier-device: DEVICE or NULL
  1529. .br
  1530. grab-window: WINDOW
  1531. .br
  1532. owner-events: BOOL
  1533. .br
  1534. event-list: LISTofEVENTCLASS
  1535. .br
  1536. this-device-mode: {Synchronous, Asynchronous}
  1537. .br
  1538. other-device-mode: {Synchronous, Asynchronous}
  1539. .br
  1540. .sp
  1541. Errors:  Device, Match, Window, Access, Value
  1542. .br
  1543. .in -.5i
  1544. .sp 1.5
  1545. .LP
  1546. This request is analogous to the core \fBGrabButton\fP request.  It 
  1547. establishes an explicit passive grab for a button on an extension input 
  1548. device.  Since the server does not track extension devices, no cursor is 
  1549. specified with this request.  For the same reason, there is no 
  1550. confine-to parameter.  The device must have previously been opened using the
  1551. \fBOpenDevice\fP request.
  1552. .LP
  1553. The \fBGrabDeviceButton\fP request establishes a passive grab on a device.
  1554. Consequently, in the future, 
  1555. .IP \(bu 3n
  1556. IF the device is not grabbed and the specified button is logically pressed
  1557. when the specified modifier keys logically are down 
  1558. (and no other buttons or modifier keys are down),
  1559. .IP \(bu 3n
  1560. AND the grab window contains the device,
  1561. .IP \(bu 3n
  1562. AND a passive grab on the same device and button/ key combination does not 
  1563. exist on any ancestor of the grab window,
  1564. .IP \(bu 3n
  1565. THEN the device is actively grabbed, as for \fBGrabDevice\fP,
  1566. the last-grab time is set to the time at which the button was pressed
  1567. (as transmitted in the \fBDeviceButtonPress\fP event), and the 
  1568. \fBDeviceButtonPress\fP event is reported.
  1569. .LP
  1570. The interpretation of the remaining arguments is as for 
  1571. \fBGrabDevice\fP.
  1572. The active grab is terminated automatically when logical state of the
  1573. device has all buttons released (independent of the logical state of 
  1574. the modifier keys).
  1575. .LP
  1576. Note that the logical state of a device (as seen by means of the X protocol)
  1577. may lag the physical state if device event processing is frozen.
  1578. .LP
  1579. A modifier of \fBAnyModifier\fP is equivalent to issuing the request for all
  1580. possible modifier combinations (including the combination of no modifiers).  
  1581. It is not required that all modifiers specified have currently assigned 
  1582. keycodes.  A button of \fBAnyButton\fP is equivalent to issuing the request 
  1583. for all possible buttons.  It is not required that the 
  1584. specified button be assigned to a physical button.
  1585. .LP
  1586. \fBNULL\fP may be passed for the modifier_device.  If the modifier_device is
  1587. \fBNULL\fP, the core X keyboard is used as the modifier_device.
  1588. .LP
  1589. An \fBAccess\fP error is generated if some other client has issued a 
  1590. \fBGrabDeviceButton\fP with the same device and button combination on the 
  1591. same window.  When using \fBAnyModifier\fP or \fBAnyButton\fP, the request 
  1592. fails completely and the X server generates a \fBAccess\fP
  1593. error and no grabs are established if there is a conflicting grab for any 
  1594. combination.  The request has no effect on an active grab.
  1595. .LP
  1596. This request cannot be used to grab a button on the X pointer
  1597. device.  The core \fBGrabButton\fP request should be used for that
  1598. purpose.
  1599. .LP
  1600. To release a passive grab of a button on an extension device, use 
  1601. \fBUngrabDeviceButton\fP.
  1602. .sp 1.5
  1603. UngrabDeviceButton
  1604. .br
  1605. .LP
  1606. .in .5i
  1607. device: DEVICE
  1608. .br
  1609. button: BUTTON or AnyButton
  1610. .br
  1611. modifiers: SETofKEYMASK or AnyModifier
  1612. .br
  1613. modifier-device: DEVICE or NULL
  1614. .br
  1615. grab-window: WINDOW
  1616. .br
  1617. .sp
  1618. .br
  1619. Errors:  Device, Match, Window, Value, Alloc
  1620. .br
  1621. .in -.5i
  1622. .sp 1.5
  1623. .LP
  1624. This request is analogous to the core UngrabButton request.  It releases 
  1625. the passive button/key combination on the specified window if it was grabbed
  1626. by the client.  A modifiers of \fBAnyModifier\fP is equivalent to issuing the
  1627. request for all possible modifier combinations (including the combination
  1628. of no modifiers).  A button of \fBAnyButton\fP is equivalent to issuing the
  1629. request for all possible buttons.  This request has no effect on an
  1630. active grab. The device must have previously been opened using the
  1631. \fBOpenDevice\fP request otherwise a \fBDevice\fP error will be 
  1632. generated.
  1633. .LP
  1634. \fBNULL\fP may be passed for the modifier_device.  If the modifier_device is
  1635. \fBNULL\fP, the core X keyboard is used as the modifier_device.
  1636. .LP
  1637. This request cannot be used to ungrab a button on the X pointer
  1638. device.  The core \fBUngrabButton\fP request should be used for that 
  1639. purpose.
  1640. .NH 2
  1641. Thawing A Device
  1642. .XS
  1643. \*(SN Thawing A Device
  1644. .XE
  1645. .LP
  1646. To allow further events to be processed when a device has been frozen,
  1647. use \fBAllowDeviceEvents\fR.
  1648. .sp 1.5
  1649. AllowDeviceEvents 
  1650. .br
  1651. .in .5i
  1652. device: DEVICE
  1653. .br
  1654. event-mode: {AsyncThisDevice, SyncThisDevice, AsyncOtherDevices, 
  1655. ReplayThisdevice, AsyncAll, or SyncAll}
  1656. .br
  1657. time:TIMESTAMP or CurrentTime
  1658. .br
  1659. .sp
  1660. Errors:  Device, Value
  1661. .br
  1662. .in -.5i
  1663. .sp 1.5
  1664. .LP
  1665. The \fBAllowDeviceEvents\fP request releases some queued events if the client
  1666. has caused a device to freeze.  The request has no effect if the 
  1667. specified time is earlier than the last-grab time of the most recent 
  1668. active grab for the client, or if the specified time is later than the 
  1669. current X server time.
  1670. .LP
  1671. The following describes the processing that occurs depending on what constant
  1672. you pass to the event-mode argument:
  1673. .IP \(bu 3n \fBAsyncThisDevice\fP
  1674. If the specified device is frozen by the client,
  1675. event processing for that device
  1676. continues as usual.  If the device is frozen multiple times  by the client on 
  1677. behalf of multiple separate grabs, AsyncThisDevice thaws for all.
  1678. AsyncThisDevice has no effect if the specified device is not frozen by the 
  1679. client, but the device need not be grabbed by the client.
  1680. .IP \(bu 3n \fBSyncThisDevice\fP 
  1681. If the specified device is frozen and actively grabbed by the client,
  1682. event processing for that device continues normally until the next 
  1683. button or key event is reported to the client.
  1684. At this time, 
  1685. the specified device again appears to freeze.
  1686. However, if the reported event causes the grab to be released,
  1687. the specified device does not freeze.
  1688. SyncThisDevice has no effect if the specified device is not frozen by the client
  1689. or is not grabbed by the client.
  1690. .IP \(bu 3n \fBReplayThisDevice\fP
  1691. If the specified device is actively grabbed by the client and is frozen 
  1692. as the result of an event having been sent to the client (either from the 
  1693. activation of a GrabDeviceButton or from a previous AllowDeviceEvents with 
  1694. mode SyncThisDevice, but not from a Grab),
  1695. the grab is released and that event is completely reprocessed.
  1696. This time, however, the request ignores any passive grabs at or above 
  1697. (towards the root) the grab-window of the grab just released.
  1698. The request has no effect if the specified device is not grabbed by the client
  1699. or if it is not frozen as the result of an event.
  1700. .IP \(bu 3n \fBAsyncOtherDevices\fP
  1701. If the remaining devices are frozen by the client,
  1702. event processing for them continues as usual.
  1703. If the other devices are frozen multiple times  by the client on behalf of 
  1704. multiple separate grabs,
  1705. AsyncOtherDevices ``thaws'' for all.
  1706. AsyncOtherDevices has no effect if the devices are not frozen by the client,
  1707. but those devices need not be grabbed by the client.
  1708. .IP \(bu 3n \fBSyncAll\fP
  1709. If all devices are frozen by the client,
  1710. event processing (for all devices) continues normally until the next
  1711. button or key event is reported
  1712. to the client for a grabbed device (button event for the grabbed device, key
  1713. or motion event for the device), at which time the devices again appear to
  1714. freeze.  However, if the reported event causes the grab to be released,
  1715. then the devices do not freeze (but if any device is still
  1716. grabbed, then a subsequent event for it will still cause all devices
  1717. to freeze).  
  1718. SyncAll has no effect unless all devices
  1719. are frozen by the client.  If any device is frozen twice
  1720. by the client on behalf of two separate grabs, 
  1721. SyncAll "thaws" for both (but a subsequent freeze for SyncAll
  1722. will only freeze each device once).
  1723. .IP \(bu 3n \fBAsyncAll\fP
  1724. If all devices are frozen by the
  1725. client, event processing (for all devices) continues normally.
  1726. If any device is frozen multiple times by the client on behalf of multiple
  1727. separate grabs, AsyncAll "thaws" for all.
  1728. AsyncAll has no effect unless all
  1729. devices are frozen by the client.
  1730. .LP
  1731. AsyncThisDevice, SyncThisDevice, and ReplayThisDevice 
  1732. have no effect on the processing of events from the remaining devices.
  1733. AsyncOtherDevices has no effect on the processing of events from the 
  1734. specified device.
  1735. When the event_mode is SyncAll or AsyncAll, the 
  1736. device parameter is ignored.
  1737. .LP
  1738. It is possible for several grabs of different devices (by the same 
  1739. or different clients) to be active simultaneously.
  1740. If a device is frozen on behalf of any grab,
  1741. no event processing is performed for the device.
  1742. It is possible for a single device to be frozen because of several grabs.
  1743. In this case,
  1744. the freeze must be released on behalf of each grab before events can 
  1745. again be processed.
  1746. .LP
  1747. .NH 2
  1748. Controlling Device Focus
  1749. .XS
  1750. \*(SN Controlling Device Focus
  1751. .XE
  1752. .LP
  1753. The current focus window for an extension input device can be 
  1754. determined using the \fBGetDeviceFocus\fP request.
  1755. Extension devices are focused using the \fBSetDeviceFocus\fP
  1756. request in the same way that the keyboard is focused using
  1757. the \fBSetInputFocus\fP request, except that a device is specified as
  1758. part of the request. One additional focus state, \fBFollowKeyboard\fP,
  1759. is provided for extension devices.
  1760. .LP
  1761. To get the current focus state, revert state, and focus time of an extension device,
  1762. use \fBGetDeviceFocus\fP.
  1763. .sp 1.5
  1764. GetDeviceFocus
  1765. .br
  1766. .LP
  1767. .in .5i
  1768. device: DEVICE
  1769. .br
  1770. .in -.5i
  1771. =>
  1772. .in +.5i
  1773. focus: WINDOW, PointerRoot, FollowKeyboard, or None
  1774. .br
  1775. revert-to: Parent, PointerRoot, FollowKeyboard, or None
  1776. .br
  1777. focus-time: TIMESTAMP
  1778. .br
  1779. .sp
  1780. Errors:  Device, Match
  1781. .br
  1782. .in -.5i
  1783. .sp 1.5
  1784. .LP
  1785. This request returns the current focus state, revert-to state, 
  1786. and last-focus-time of an extension device.
  1787. .LP
  1788. To set the focus of an extension device, use \fBSetDeviceFocus\fP.
  1789. .sp 1.5
  1790. SetDeviceFocus 
  1791. .br
  1792. .in .5i
  1793. device: DEVICE
  1794. .br
  1795. focus: WINDOW, PointerRoot, FollowKeyboard, or None
  1796. .br
  1797. revert-to: Parent, PointerRoot, FollowKeyboard, or None
  1798. .br
  1799. focus-time: TIMESTAMP
  1800. .br
  1801. .sp
  1802. Errors:  Device, Window, Value, Match
  1803. .br
  1804. .in -.5i
  1805. .sp 1.5
  1806. .LP
  1807. This request changes the focus for an extension input device and the 
  1808. last-focus-change-time.  The request has no effect if the specified 
  1809. time is earlier than the last-focus-change-time or is later than the
  1810. current X server time.  Otherwise, the last-focus-change-time is set to the
  1811. specified time, with CurrentTime replaced by the current server time.
  1812. .LP
  1813. The action taken by the server when this request is requested depends
  1814. on the value of the focus argument:
  1815. .IP \(bu 3n
  1816. If the focus argument is \fBNone\fP, all input events from this device
  1817. will be discarded until a new focus window is set.  In this case, the
  1818. revert-to argument is ignored.
  1819. .IP \(bu 3n
  1820. If a window ID is assigned to the focus argument, it becomes the focus
  1821. window of the device.  If an input event from the device would normally
  1822. be reported to this window or to one of its inferiors, the event is 
  1823. reported normally.  Otherwise, the event is reported relative to the focus 
  1824. window.
  1825. .IP \(bu 3n
  1826. If you assign \fBPointerRoot\fP to the focus argument, the focus window is 
  1827. dynamically taken to be the root window of whatever screen the pointer is
  1828. on at each input event.  In this case, the revert-to argument is ignored.
  1829. .IP \(bu 3n
  1830. If you assign \fBFollowKeyboard\fP to the focus argument, the focus window is 
  1831. dynamically taken to be the same as the focus of the X keyboard at each
  1832. input event.
  1833. .LP
  1834. The specified focus window must be viewable at the time of the request 
  1835. (else a \fBMatch\fP error).  If the focus window later becomes not viewable, 
  1836. the X server evaluates the revert-to argument
  1837. to determine the new focus window.
  1838. .IP \(bu 3n
  1839. If you assign \fBRevertToParent\fP
  1840. to the revert-to argument, the focus reverts to the parent
  1841. (or the closest viewable ancestor), and the new revert-to value is taken to
  1842. be \fBRevertToNone\fP.
  1843. .IP \(bu 3n
  1844. If you assign \fBRevertToPointerRoot\fP, \fBRevertToFollowKeyboard\fP, or \fBRevertToNone\fP
  1845. to the revert-to argument, the focus reverts to that value.
  1846. .LP
  1847. When the focus reverts,
  1848. the X server generates \fBDeviceFocusIn\fP
  1849. and \fBDeviceFocusOut\fP
  1850. events, but the last-focus-change time is not affected.
  1851. .LP
  1852. This request causes the X server to generate \fBDeviceFocusIn\fP and 
  1853. \fBDeviceFocusOut\fP events.
  1854. .NH 2
  1855. Controlling Device Feedback
  1856. .XS
  1857. \*(SN Controlling Device Feedback
  1858. .XE
  1859. .LP
  1860. To get the settings of feedbacks on an extension device, use
  1861. \fBGetFeedbackControl\fP.   This request provides functionality equivalent to
  1862. the core \fBGetKeyboardControl\fP and \fBGetPointerControl\fP functions.  It
  1863. also provides a way to control displays associated with an input device that
  1864. are capable of displaying an integer or string.
  1865. .sp 1.5
  1866. GetFeedbackControl 
  1867. .br
  1868. .in .5i
  1869. device: DEVICE
  1870. .br
  1871. .in -.5i
  1872. =>
  1873. .in +.5i
  1874. num_feedbacks_return: CARD16
  1875. .br
  1876. return_value: LISTofFEEDBACKSTATE
  1877. .br
  1878. .sp
  1879. where
  1880. .br
  1881. .in +.5i
  1882. .TS
  1883. l lw(4i).
  1884. T{
  1885. FEEDBACKSTATE:
  1886. T}    T{
  1887. {KbdFeedbackState, PtrFeedbackState, IntegerFeedbackState, StringFeedbackState, BellFeedbackState, LedFeedbackState}
  1888. T}
  1889. .TE
  1890. .in -1.0i
  1891. .LP
  1892. Feedbacks are reported by class.  Those
  1893. feedbacks that are reported for the core keyboard device are in class
  1894. \fBKbdFeedback\fP, and are returned in the 
  1895. \fBKbdFeedbackState\fP structure.  The members of that structure are as follows:
  1896. .in +.5i
  1897. .TS
  1898. l lw(4i).
  1899. T{
  1900. CLASS Kbd:
  1901. T}    T{
  1902. [class: CARD8
  1903. .br 
  1904. \ length: CARD16
  1905. .br
  1906. \ feedback id: CARD8
  1907. .br
  1908. \ key_click_percent: CARD8
  1909. .br
  1910. \ bell_percent: CARD8
  1911. .br
  1912. \ bell_pitch: CARD16
  1913. .br
  1914. \ bell_duration: CARD16
  1915. .br
  1916. \ led_value: BITMASK
  1917. .br
  1918. \ global_auto_repeat: {AutoRepeatModeOn, AutoRepeatModeOff}
  1919. .br
  1920. \ auto_repeats: LISTofCARD8]
  1921. T}
  1922. .TE
  1923. .in -.5i
  1924. .LP
  1925. Those feedbacks that are equivalent to those reported for the core pointer
  1926. are in feedback class \fBPtrFeedback\fP and are reported in the 
  1927. \fBPtrFeedbackState\fP structure.  The members of that structure are:
  1928. .LP
  1929. .in +.5i
  1930. .TS
  1931. l lw(4i).
  1932. T{
  1933. CLASS Ptr:
  1934. T}    T{
  1935. [class: CARD8
  1936. .br
  1937. \ length: CARD16
  1938. .br
  1939. \ feedback id: CARD8
  1940. .br
  1941. \ accelNumerator: CARD16
  1942. .br
  1943. \ accelDenominator: CARD16
  1944. .br
  1945. \ threshold: CARD16]
  1946. T}
  1947. .TE
  1948. .in -.5i
  1949. .LP
  1950. Some input devices provide a means of displaying an integer.  Those devices
  1951. will support feedback class \fBIntegerFeedback\fP, which is reported in the 
  1952. \fBIntegerFeedbackState\fP structure.  The members of that structure are:
  1953. .LP
  1954. .br
  1955. .sp
  1956. .in +.5i
  1957. .TS
  1958. l lw(4i).
  1959. T{
  1960. CLASS Integer:
  1961. T}    T{
  1962. [class: CARD8
  1963. .br
  1964. \ length: CARD16
  1965. .br
  1966. \ feedback id: CARD8
  1967. .br
  1968. \ resolution: CARD32
  1969. .br
  1970. \ min-val: INT32
  1971. .br
  1972. \ max-val: INT32]
  1973. T}
  1974. .TE
  1975. .in -.5i
  1976. .br
  1977. .LP
  1978. Some input devices provide a means of displaying a string.  Those devices
  1979. will support feedback class \fBStringFeedback\fP, which is reported in the 
  1980. \fBStringFeedbackState\fP structure.  The members of that structure are:
  1981. .LP
  1982. .in +.5i
  1983. .TS
  1984. l lw(4i).
  1985. T{
  1986. CLASS String:
  1987. T}    T{
  1988. [class: CARD8
  1989. .br
  1990. \ length: CARD16
  1991. .br
  1992. \ feedback id: CARD8
  1993. .br
  1994. \ max_symbols: CARD16
  1995. .br
  1996. \ num_keysyms_supported: CARD16
  1997. .br
  1998. \ keysyms_supported: LISTofKEYSYM]
  1999. T}
  2000. .TE
  2001. .in -.5i
  2002. .br
  2003. .LP
  2004. Some input devices contain a bell.  Those devices
  2005. will support feedback class \fBBellFeedback\fP, which is reported in the 
  2006. \fBBellFeedbackState\fP structure.  The members of that structure are:
  2007. .LP
  2008. .sp
  2009. .in +.5i
  2010. .TS
  2011. l lw(4i).
  2012. T{
  2013. CLASS Bell:
  2014. T}    T{
  2015. [class: CARD8
  2016. .br
  2017. \ length: CARD16
  2018. .br
  2019. \ feedback id: CARD8
  2020. .br
  2021. \ percent: CARD8
  2022. .br
  2023. \ pitch: CARD16
  2024. .br
  2025. \ duration: CARD16]
  2026. T}
  2027. .TE
  2028. .in -.5i
  2029. .br
  2030. .sp
  2031. The percent sets the base volume for the bell between 0 (off) and 100
  2032. (loud) inclusive, if possible.  Setting to \-1 restores the default.
  2033. Other negative values generate a \fBValue\fP error.
  2034. .LP
  2035. The pitch sets the pitch (specified in Hz) of the bell, if possible.
  2036. Setting to \-1 restores the default.  Other negative values generate a 
  2037. \fBValue\fP error.
  2038. .LP
  2039. The duration sets the duration (specified in milliseconds) of the
  2040. bell, if possible.  Setting to \-1 restores the default.
  2041. Other negative values generate a \fBValue\fP error.
  2042. .LP
  2043. A bell generator connected with the console but not directly on the
  2044. device is treated as if it were part of the device.
  2045. Some input devices contain LEDs.  Those devices
  2046. will support feedback class \fBLed\fP, which is reported in the 
  2047. \fBLedFeedbackState\fP structure.  The members of that structure are:
  2048. .LP
  2049. .sp
  2050. .in +.5i
  2051. .TS
  2052. l lw(4i).
  2053. T{
  2054. CLASS Led:
  2055. T}    T{
  2056. [class: CARD8
  2057. .br
  2058. \ length: CARD16
  2059. .br
  2060. \ feedback id: CARD8
  2061. .br
  2062. \ led_mask: BITMASK
  2063. .br
  2064. \ led_value: BITMASK]
  2065. T}
  2066. .TE
  2067. .in -.5i
  2068. .br
  2069. .LP
  2070. Each bit in led_mask indicates that the corresponding led is supported by
  2071. the feedback.  At most 32 LEDs per feedback are supported.  
  2072. No standard interpretation of LEDs is defined.
  2073. .LP
  2074. This function will fail with a \fBBadMatch\fP error if the device specified 
  2075. in the request does not support feedbacks.
  2076. .LP
  2077. Errors:  Device, Match, Feedback
  2078. .LP
  2079. To change the settings of a feedback on an extension device, use
  2080. \fBChangeFeedbackControl\fP.
  2081. .sp 1.5
  2082. ChangeFeedbackControl 
  2083. .br
  2084. .in .5i
  2085. device: DEVICE
  2086. .br
  2087. feedbackid: CARD8
  2088. .br
  2089. value-mask: BITMASK
  2090. .br
  2091. value: FEEDBACKCONTROL
  2092. .br
  2093. .sp
  2094. Errors:  Device, Match, Value
  2095. .br
  2096. .in -.5i
  2097. .sp 1.5
  2098. .TS
  2099. l lw(4i).
  2100. .sp
  2101. T{
  2102. FEEDBACKCONTROL:
  2103. T}    T{
  2104. {KBDFEEDBACKCONTROL, PTRFEEDBACKCONTROL, INTEGERFEEDBACKCONTROL,
  2105. STRINGFEEDBACKCONTROL, BELLFEEDBACKCONTROL, LEDFEEDBACKCONTROL}
  2106. T}
  2107. .TE
  2108. .br
  2109. .LP
  2110. Feedback controls are grouped by class.  Those feedbacks that are 
  2111. equivalent to those supported by the core keyboard are controlled
  2112. by feedback class \fBKbdFeedbackClass\fP using the \fBKbdFeedbackControl\fP
  2113. structure.  The members of that structure are:
  2114. .in +.5i
  2115. .TS
  2116. l lw(4i).
  2117. T{
  2118. KBDFEEDBACKCTL:
  2119. T}    T{
  2120. [class: CARD8
  2121. .br
  2122. \ length: CARD16
  2123. .br
  2124. \ feedback id: CARD8
  2125. .br
  2126. \ key_click_percent: INT8
  2127. .br
  2128. \ bell_percent: INT8
  2129. .br
  2130. \ bell_pitch: INT16
  2131. .br
  2132. \ bell_duration: INT16
  2133. .br
  2134. \ led_mask: INT32
  2135. .br
  2136. \ led_value: INT32
  2137. .br
  2138. \ key: KEYCODE
  2139. .br
  2140. \ auto_repeat_mode: {AutoRepeatModeOn, AutoRepeatModeOff, AutoRepeatModeDefault}]
  2141. T}
  2142. .TE
  2143. .in -.5i
  2144. .LP
  2145. The key_click_percent sets the volume for key clicks between 0 (off) and
  2146. 100 (loud) inclusive, if possible.  Setting to \-1 restores the default.
  2147. Other negative values generate a \fBValue\fP error.
  2148. .LP
  2149. If both auto_repeat_mode and key are specified, then the auto_repeat_mode 
  2150. of that key is changed, if possible.  If only auto_repeat_mode is specified,
  2151. then the global auto-repeat mode for the entire keyboard is changed,
  2152. if possible, without affecting the per-key settings.  It is a \fBMatch\fP
  2153. error if a key is specified without an auto_repeat_mode.
  2154. .LP
  2155. The order in which controls are verified and altered is server-dependent.
  2156. If an error is generated, a subset of the controls may have been altered.
  2157. .LP
  2158. Those feedback controls equivalent to those of the core pointer are 
  2159. controlled by feedback class \fBPtrFeedbackClass\fP using the 
  2160. \fBPtrFeedbackControl\fP
  2161. structure.  The members of that structure are as follows:
  2162. .LP
  2163. .in +.5i
  2164. .TS
  2165. l lw(4i).
  2166. T{
  2167. PTRFEEDBACKCTL:
  2168. T}    T{
  2169. [class: CARD8
  2170. .br
  2171. \ length: CARD16
  2172. .br
  2173. \ feedback id: CARD8
  2174. .br
  2175. \ accelNumerator: INT16
  2176. .br
  2177. accelDenominator: INT16
  2178. .br
  2179. \ threshold: INT16]
  2180. T}
  2181. .TE
  2182. .in -.5i
  2183. .LP
  2184. The acceleration, expressed as a fraction, is a multiplier 
  2185. for movement. For example, specifying 3/1 means the device moves three 
  2186. times as fast as normal.  The fraction may be rounded arbitrarily by the 
  2187. X server.  Acceleration only takes effect if the device moves more than 
  2188. threshold pixels at once and only applies to the amount beyond the value 
  2189. in the threshold argument.  Setting a value to -1 restores the default.
  2190. The values of the do-accel and do-threshold arguments must be nonzero for
  2191. the device values to be set.  Otherwise, the parameters will be unchanged.
  2192. Negative values generate a \fBValue\fP error, as does a zero value
  2193. for the accel-denominator argument.
  2194. .LP
  2195. Some devices are capable of displaying an integer.  This is done using
  2196. feedback class \fBIntegerFeedbackClass\fP using the \fBIntegerFeedbackControl\fP
  2197. structure.  The members of that structure are as follows:
  2198. .sp
  2199. .in +.5i
  2200. .TS
  2201. l lw(4i).
  2202. T{
  2203. INTEGERCTL:
  2204. T}    T{
  2205. [class: CARD8
  2206. .br
  2207. \ length: CARD16
  2208. .br
  2209. \ feedback id: CARD8
  2210. .br
  2211. \ int_to_display: INT32]
  2212. T}
  2213. .TE
  2214. .in -.5i
  2215. .LP
  2216. Some devices are capable of displaying an string.  This is done using
  2217. feedback class \fBStringFeedbackClass\fP using the \fBStringFeedbackCtl\fP
  2218. structure.  The members of that structure are as follows:
  2219. .sp
  2220. .in +.5i
  2221. .TS
  2222. l lw(4i).
  2223. T{
  2224. STRINGCTL:
  2225. T}    T{
  2226. [class: CARD8
  2227. .br
  2228. \ length: CARD16
  2229. .br
  2230. \ feedback id: CARD8
  2231. .br
  2232. \ syms_to_display: LISTofKEYSYMS]
  2233. T}
  2234. .TE
  2235. .in -.5i
  2236. .LP
  2237. Some devices contain a bell.  This is done using
  2238. feedback class \fBBellFeedbackClass\fP using the \fBBellFeedbackControl\fP
  2239. structure.  The members of that structure are as follows:
  2240. .sp
  2241. .in +.5i
  2242. .TS
  2243. l lw(4i).
  2244. T{
  2245. BELLCTL:
  2246. T}    T{
  2247. [class: CARD8
  2248. .br
  2249. \ length: CARD16
  2250. .br
  2251. \ feedback id: CARD8
  2252. .br
  2253. \ percent: INT8
  2254. .br
  2255. \ pitch: INT16
  2256. .br
  2257. \ duration: INT16]
  2258. T}
  2259. .TE
  2260. .in -.5i
  2261. .LP
  2262. Some devices contain leds.  These can be turned on and off using
  2263. the \fBLedFeedbackControl\fP
  2264. structure.  The members of that structure are as follows:
  2265. .sp
  2266. .in +.5i
  2267. .TS
  2268. l lw(4i).
  2269. T{
  2270. LEDCTL:
  2271. T}    T{
  2272. [class: CARD8
  2273. .br
  2274. \ length: CARD16
  2275. .br
  2276. \ feedback id: CARD8
  2277. .br
  2278. \ led_mask: BITMASK
  2279. .br
  2280. \ led_value: BITMASK]
  2281. T}
  2282. .TE
  2283. .in -.5i
  2284. .LP
  2285. Errors:  Device, Match, Value
  2286. .LP
  2287. .NH 2
  2288. Ringing a Bell on an Input Device
  2289. .XS
  2290. \*(SN Ringing a Bell on an Input Device
  2291. .XE
  2292. .LP
  2293. To ring a bell on an extension input device, use \fBDeviceBell\fP.
  2294. .sp 1.5
  2295. DeviceBell
  2296. .br
  2297. .LP
  2298. .in .5i
  2299. device: DEVICE
  2300. .br
  2301. feedbackclass: CARD8
  2302. .br
  2303. feedbackid: CARD8
  2304. .br
  2305. percent: INT8
  2306. .br
  2307. .in -.5i
  2308. Errors: Device, Value
  2309. .br
  2310. .in -.5i
  2311. .sp 1.5
  2312. .LP
  2313. This request is analogous to the core \fBBell\fP request.  It rings the 
  2314. specified bell on the specified input device feedback, using the specified
  2315. volume.
  2316. The specified volume is relative to the base volume for the feedback.
  2317. If the value for the percent argument is not in the range -100 to 100
  2318. inclusive, a \fBValue\fP error results.
  2319. The volume at which the bell rings when the percent argument is nonnegative is:
  2320. .LP
  2321. .DS
  2322.       base - [(base * percent) / 100] + percent
  2323. .DE
  2324. .LP
  2325. The volume at which the bell rings
  2326. when the percent argument is negative is:
  2327. .DS
  2328.       base + [(base * percent) / 100]
  2329. .DE
  2330. .LP
  2331. To change the base volume of the bell, use \fBChangeFeedbackControl\fP request.
  2332. .LP
  2333. .NH 2
  2334. Controlling Device Encoding
  2335. .XS
  2336. \*(SN Controlling Device Encoding
  2337. .XE
  2338. .LP
  2339. To get the keyboard mapping of an extension device that has keys, use 
  2340. \fBGetDeviceKeyMapping\fP.
  2341. .sp 1.5
  2342. GetDeviceKeyMapping
  2343. .br
  2344. .LP
  2345. .in .5i
  2346. device: DEVICE
  2347. .br
  2348. first-keycode: KEYCODE
  2349. .br
  2350. count: CARD8
  2351. .br
  2352. .in -.5i
  2353. =>
  2354. .in +.5i
  2355. keysyms-per-keycode: CARD8
  2356. .br
  2357. keysyms: LISTofKEYSYM
  2358. .br
  2359. .sp
  2360. Errors: Device, Match, Value
  2361. .br
  2362. .in -.5i
  2363. .sp 1.5
  2364. .LP
  2365. This request returns the symbols for the specified number of keycodes for the 
  2366. specified extension device, starting with the specified keycode.
  2367. The first-keycode must be greater than or equal to
  2368. min-keycode as returned in the connection setup (else a \fBValue\fP error),
  2369. and
  2370. .LP
  2371. .DS
  2372. first-keycode + count \- 1
  2373. .DE
  2374. .LP
  2375. must be less than or equal to max-keycode as returned in the connection setup
  2376. (else a \fBValue\fP error).
  2377. The number of elements in the keysyms list is
  2378. .LP
  2379. .DS
  2380. count * keysyms-per-keycode
  2381. .DE
  2382. and KEYSYM number N (counting from zero) for keycode K has an index
  2383. (counting from zero) of
  2384. .LP
  2385. .DS
  2386. (K \- first-keycode) * keysyms-per-keycode + N
  2387. .DE
  2388. .LP
  2389. in keysyms.
  2390. The keysyms-per-keycode value is chosen arbitrarily by the server
  2391. to be large enough to report all requested symbols.
  2392. A special KEYSYM value of
  2393. \fBNoSymbol\fP
  2394. is used to fill in unused elements for individual keycodes.
  2395. .LP
  2396. If the specified device has not first been opened by this client via
  2397. \fBOpenDevice\fP, or if that device does not support input class Keys,
  2398. this request will fail with a \fBDevice\fP error.
  2399. .LP
  2400. To change the keyboard mapping of an extension device that has keys, use 
  2401. \fBChangeDeviceKeyMapping\fP.
  2402. .sp 1.5
  2403. ChangeDeviceKeyMapping
  2404. .br
  2405. .in .5i
  2406. device: DEVICE
  2407. .br
  2408. first-keycode: KEYCODE
  2409. .br
  2410. keysyms-per-keycode: CARD8
  2411. .br
  2412. keysyms: LISTofKEYSYM
  2413. .br
  2414. num_codes: CARD8
  2415. .br
  2416. .sp
  2417. Errors:  Device, Match, Value, Alloc
  2418. .br
  2419. .in -.5i
  2420. .sp 1.5
  2421. .LP
  2422. This request is analogous to the core \fBChangeKeyMapping\fP request.  
  2423. It defines the symbols for the specified number of keycodes for the 
  2424. specified extension device.
  2425. If the specified device has not first been opened by this client via
  2426. \fBOpenDevice\fP, or if that device does not support input class Keys,
  2427. this request will fail with a \fBDevice\fP error.
  2428. .LP
  2429. The number of elements in the keysyms list must be a multiple of
  2430. keysyms_per_keycode.  Otherwise, \fBChangeDeviceKeyMapping\fP generates
  2431. a \fBLength\fP error.  The specified first_keycode must be greater
  2432. than or equal to the min_keycode value returned by the \fBListInputDevices\fP
  2433. request, or this request will fail with a \fBValue\fP error.  In addition,
  2434. if the following expression is not less than the max_keycode value returned by
  2435. the \fBListInputDevices\fP request, the request will fail with a \fBValue\fP
  2436. error:
  2437. .LP
  2438. .DS
  2439.       first_keycode + (num_codes / keysyms_per_keycode) - 1
  2440. .DE
  2441. .LP
  2442. To obtain the keycodes that are used as modifiers on an 
  2443. extension device that has keys, use \fBGetDeviceModifierMapping\fP.
  2444. .sp 1.5
  2445. GetDeviceModifierMapping
  2446. .br
  2447. .in .5i
  2448. device: DEVICE
  2449. .br
  2450. .in -.5i
  2451. =>
  2452. .br
  2453. .in +.5i
  2454. keycodes-per-modifier: CARD8
  2455. .br
  2456. keycodes: LISTofKEYCODE
  2457. .br
  2458. .sp
  2459. Errors:  Device, Match
  2460. .br
  2461. .in -.5i
  2462. .sp 1.5
  2463. .LP
  2464. This request is analogous to the core \fBGetModifierMapping\fP request.  
  2465. This request returns the keycodes of the keys being used as modifiers.
  2466. The number of keycodes in the list is 8*keycodes-per-modifier.
  2467. The keycodes are divided into eight sets, with each set containing 
  2468. keycodes-per-modifier elements.  The sets are assigned in order to the 
  2469. modifiers \fBShift\fP, \fBLock\fP, \fBControl\fP, \fBMod1\fP, \fBMod2\fP,
  2470. \fBMod3\fP, \fBMod4\fP, and \fBMod5\fP. The keycodes-per-modifier value is 
  2471. chosen arbitrarily by the server; zeroes are used to fill in unused elements 
  2472. within each set.  If only zero values are given in a set, the use of the 
  2473. corresponding modifier has been disabled.  The order of keycodes within 
  2474. each set is chosen arbitrarily by the server.
  2475. .LP
  2476. To set which keycodes that are to be used as modifiers for an extension
  2477. device, use \fBSetDeviceModifierMapping\fP.
  2478. .sp 1.5
  2479. SetDeviceModifierMapping
  2480. .br
  2481. .LP
  2482. .in .5i
  2483. device: DEVICE
  2484. .br
  2485. keycodes-per-modifier: CARD8
  2486. .br
  2487. keycodes: LISTofKEYCODE
  2488. .br
  2489. .in -.5i
  2490. =>
  2491. .br
  2492. .in +.5i
  2493. status: {Success, Busy, Failed}
  2494. .br
  2495. .sp
  2496. Errors:  Device, Match, Value, Alloc
  2497. .in -.5i
  2498. .sp 1.5
  2499. .LP
  2500. This request is analogous to the core \fBSetModifierMapping\fP request.  
  2501. This request specifies the keycodes (if any) of the keys to be used as
  2502. modifiers.  The number of keycodes in the list must be 
  2503. 8*keycodes-per-modifier (else a \fBLength\fP error).  The keycodes are 
  2504. divided into eight sets, with the sets, with each set containing 
  2505. keycodes-per-modifier elements.  The sets are assigned in order to the 
  2506. modifiers \fBShift\fP, \fBLock\fP, \fBControl\fP, \fBMod1\fP, \fBMod2\fP,
  2507. \fBMod3\fP, \fBMod4\fP, and \fBMod5\fP.  Only non-zero keycode values are 
  2508. used within each set; zero values are ignored.  All of the non-zero 
  2509. keycodes must be in the range specified by min-keycode and max-keycode 
  2510. in the \fBListInputDevices\fP request (else a \fBValue\fP error).  The order of 
  2511. keycodes within a set does not matter.  If no non-zero values are specified 
  2512. in a set, the use of the corresponding modifier is disabled, and the 
  2513. modifier bit will always be zero.  Otherwise, the modifier bit will be 
  2514. one whenever at least one of the keys in the corresponding set is in the down
  2515. position.
  2516. .LP
  2517. A server can impose restrictions on how modifiers can be changed (for example,
  2518. if certain keys do not generate up transitions in hardware or if multiple keys 
  2519. per modifier are not supported).  The status reply is \fBFailed\fP
  2520. if some such restriction is violated, and none of the modifiers are changed.
  2521. .LP
  2522. If the new non-zero keycodes specified for a modifier differ from those
  2523. currently defined, and any (current or new) keys for that modifier are
  2524. logically in the down state, then the status reply is \fBBusy\fP,
  2525. and none of the modifiers are changed.
  2526. .IP
  2527. This request generates a \fPDeviceMappingNotify\fP event on a
  2528. \fBSuccess\fP status.  The \fPDeviceMappingNotify\fP event will be sent only
  2529. to those clients that have expressed an interest in receiving that event
  2530. via the \fBXSelectExtensionEvent\fP request.
  2531. .LP
  2532. A X server can impose restrictions on how modifiers can be changed, 
  2533. for example, if certain keys do not generate up transitions in hardware 
  2534. or if multiple modifier keys are not supported.  If some such restriction 
  2535. is violated, the status reply is
  2536. \fBMappingFailed\fP , and none of the modifiers are changed.
  2537. If the new keycodes specified for a modifier differ from those
  2538. currently defined and any (current or new) keys for that modifier are
  2539. in the logically down state, the status reply is \fBMappingBusy\fP, 
  2540. and none of the modifiers are changed.  
  2541. .NH 2
  2542. Controlling Button Mapping
  2543. .XS
  2544. \*(SN Controlling Button Mapping
  2545. .XE
  2546. .LP
  2547. These requests are analogous to the core \fBGetPointerMapping\fP
  2548. and \fBChangePointerMapping\fP requests.  They allow a client to
  2549. determine the current mapping of buttons on an extension device,
  2550. and to change that mapping.
  2551. .LP
  2552. To get the current button mapping for an extension device, use
  2553. \fBGetDeviceButtonMapping\fP.
  2554. .sp 1.5
  2555. GetDeviceButtonMapping 
  2556. .br
  2557. .in .5i
  2558. device: DEVICE
  2559. .br
  2560. nmap: CARD8
  2561. .br
  2562. .in -.5i
  2563. =>
  2564. .in +.5i
  2565. map_return: LISTofCARD8
  2566. .br
  2567. .sp
  2568. Errors:  Device, Match
  2569. .in -.5i
  2570. .br
  2571. .sp
  2572. .LP
  2573. The \fBGetDeviceButtonMapping\fP function returns the current mapping of
  2574. the buttons on the specified device.  Elements of the list are indexed
  2575. starting from one.  The length of the list indicates the number of 
  2576. physical buttons.  The nominal mapping is the identity mapping map[i]=i.
  2577. .LP
  2578. \fBnmap\fP indicates the number of elements in the \fBmap_return\fP 
  2579. array.  Only the first nmap entries will be copied by the library
  2580. into the map_return array.
  2581. .sp 2
  2582. .LP
  2583. To set the button mapping for an extension device, use
  2584. \fBSetDeviceButtonMapping\fP.
  2585. .sp 1.5
  2586. SetDeviceButtonMapping 
  2587. .br
  2588. .in .5i
  2589. device: DEVICE
  2590. .br
  2591. map: LISTofCARD8
  2592. .br
  2593. nmap: CARD8
  2594. .br
  2595. .sp
  2596. .in -.5i
  2597. =>
  2598. .in +.5i
  2599. status: CARD8
  2600. .br
  2601. .sp
  2602. Errors:  Device, Match, Value
  2603. .in -.5i
  2604. .br
  2605. .sp
  2606. .LP
  2607. The \fBSetDeviceButtonMapping\fP function sets the mapping of the specified
  2608. device and causes the X server to generate a \fBDeviceMappingNotify\fP
  2609. event on a status of \fBMappingSuccess\fP.  Elements of the list are
  2610. indexed starting from one.  The length of the list,
  2611. specified in \fBnmap\fP,
  2612. must be the same as
  2613. \fBGetDeviceButtonMapping\fP would return.  Otherwise,
  2614. \fBSetDeviceButtonMapping\fP generates a \fBValue\fP error.  A zero element
  2615. disables a buttons, and elements are not restricted in value by the 
  2616. number of physical buttons.  However, no two elements can have the
  2617. same nonzero value.  Otherwise, this function generates a
  2618. \fBValue\fP error.  If any of the buttons to be altered are in the 
  2619. down state, the status reply is \fBMappingBusy\fP and the mapping is
  2620. not changed. 
  2621. .NH 2
  2622. Obtaining The State Of A Device
  2623. .XS
  2624. \*(SN Obtaining The State Of A Device
  2625. .XE
  2626. .LP
  2627. To obtain vectors that describe the state of the keys, buttons and valuators
  2628. of an extension device, use \fBQueryDeviceState\fP.
  2629. .sp 1.5
  2630. QueryDeviceState 
  2631. .br
  2632. .in .5i
  2633. device: DEVICE
  2634. .br
  2635. .in -.5i
  2636. =>
  2637. .in +.5i
  2638. device-id: CARD8
  2639. .br
  2640. data: LISTofINPUTCLASS
  2641. .br
  2642. .sp
  2643. .in -.5i
  2644. where
  2645. .in +.5i
  2646. .br
  2647. .TS
  2648. l lw(4i).
  2649. T{
  2650. INPUTCLASS:
  2651. T}    T{
  2652. {VALUATOR, BUTTON, KEY}
  2653. T}
  2654. .sp
  2655. T{
  2656. CLASS VALUATOR:
  2657. T}    T{
  2658. [class: CARD8
  2659. .br
  2660. \ num_valuators: CARD8
  2661. .br
  2662. mode: CARD8
  2663. .in +.5i
  2664. .br
  2665. #x01 device mode
  2666. .in +.5i
  2667. .br
  2668. (0 = Relative, 1 = Absolute)
  2669. .br
  2670. .in -.5i
  2671. #x02 proximity state
  2672. .in +.5i
  2673. .br
  2674. (0 = InProximity, 1 = OutOfProximity)
  2675. .in -1.0i
  2676. .br
  2677. \ valuators: LISTofINT32]
  2678. T}
  2679. .br
  2680. .sp
  2681. T{
  2682. CLASS BUTTON:
  2683. T}    T{
  2684. [class: CARD8
  2685. .br
  2686. \ num_buttons: CARD8
  2687. .br
  2688. \ buttons: LISTofCARD8]
  2689. T}
  2690. .br
  2691. .sp
  2692. T{
  2693. CLASS KEY:
  2694. T}    T{
  2695. [class: CARD8
  2696. .br
  2697. \ num_keys: CARD8
  2698. .br
  2699. \ keys: LISTofCARD8]
  2700. T}
  2701. .TE
  2702. .br
  2703. .sp
  2704. Errors:  Device
  2705. .br
  2706. .in -.5i
  2707. .sp 1.5
  2708. .LP
  2709. The \fBQueryDeviceState\fP request returns the current logical state of the 
  2710. buttons, keys, and valuators on the specified input device.
  2711. The \fIbuttons\fP and \fIkeys\fP arrays, byte N (from 0) contains the
  2712. bits for key or button 8N to 8N+7 with the least significant bit in the
  2713. byte representing key or button 8N.
  2714. .LP
  2715. If the device has valuators, a bit in the mode field indicates whether the
  2716. device is reporting Absolute or Relative data.  If it is reporting Absolute
  2717. data, the valuators array will contain the current value of the valuators.
  2718. If it is reporting Relative data, the valuators array will contain undefined
  2719. data.
  2720. .LP
  2721. If the device reports proximity information, a bit in the mode field indicates
  2722. whether the device is InProximity or OutOfProximity.
  2723. .NH 1
  2724. Events
  2725. .XS
  2726. \*(SN Events
  2727. .XE
  2728. .LP
  2729. The input extension creates input events analogous to the core input events.
  2730. These extension input events are generated by manipulating one of the
  2731. extension input devices.  
  2732. .NH 2
  2733. Button, Key, and Motion Events
  2734. .XS
  2735. \*(SN Button, Key, and Motion Events
  2736. .XE
  2737. .LP
  2738. DeviceKeyPress
  2739. .br
  2740. DeviceKeyRelease
  2741. .br
  2742. DeviceButtonPress,
  2743. .br
  2744. DeviceButtonRelease 
  2745. .br
  2746. DeviceMotionNotify
  2747. .LP
  2748. .in .5i
  2749. device: CARD8
  2750. .br
  2751. root, event: WINDOW
  2752. .br
  2753. child: Window or None
  2754. .br
  2755. same-screen: BOOL
  2756. .br
  2757. root-x, root-y, event-x, event-y: INT16
  2758. .br
  2759. detail: <see below>
  2760. .br
  2761. state: SETofKEYBUTMASK
  2762. .br
  2763. time: TIMESTAMP
  2764. .TE
  2765. .in -.5i
  2766. .LP
  2767. These events are generated when a key, button, or valuator logically changes state.
  2768. The generation of these logical changes may lag the physical changes,
  2769. if device event processing is frozen.  Note that \fBDeviceKeyPress\fP
  2770. and \fBDeviceKeyRelease\fP are generated for all keys, even those mapped to modifier bits.
  2771. The ``source'' of the event is the window the pointer is in.
  2772. The window with respect to which the event is normally reported is found
  2773. by looking up the hierarchy (starting with the source window)
  2774. for the first window on which any client has selected interest in the event.
  2775. The actual window used for reporting can be modified by active grabs and
  2776. by the focus window.The window the event is reported with respect to is called 
  2777. the ``event'' window.  
  2778. .LP
  2779. The root is the root window of the ``source'' window, and root-x and root-y 
  2780. are the pointer coordinates relative to root's origin at the time of the event.
  2781. Event is the ``event'' window.  If the event window is on the same screen as 
  2782. root, then event-x and event-y are the pointer coordinates relative to the
  2783. event window's origin.  Otherwise, event-x and event-y are zero.  If the 
  2784. source window is an inferior of the event window, then child is set to 
  2785. the child of the event window that is an ancestor of (or is) the source window.
  2786. Otherwise, it is set to None. The state component gives the logical state of 
  2787. the buttons on the core X pointer and modifier keys on the core X keyboard
  2788. just before the event.  
  2789. The detail component type varies with the event type:
  2790. .TS
  2791. allbox;
  2792. l l.
  2793. T{
  2794. Event
  2795. T}    T{
  2796. Component
  2797. T}
  2798. T{
  2799. DeviceKeyPress, 
  2800. .br
  2801. DeviceKeyRelease
  2802. T}    T{
  2803. KEYCODE
  2804. T}
  2805. T{
  2806. DeviceButtonPress, 
  2807. .br
  2808. DeviceButtonRelease
  2809. T}    T{
  2810. BUTTON
  2811. T}
  2812. T{
  2813. DeviceMotionNotify
  2814. T}    T{
  2815. { Normal , Hint }
  2816. T}
  2817. .TE
  2818. .LP
  2819. The granularity of motion events is not guaranteed, but a client selecting 
  2820. for motion events is guaranteed to get at least one event when a valuator
  2821. changes. If \fBDeviceMotionHint\fP is selected, the server is free to send 
  2822. only one \fBDeviceMotionNotify\fP event (with detail \fBHint\fP) to the
  2823. client for the event window, until either a key or button changes state,
  2824. the pointer leaves the event window, or the client issues a
  2825. \fBQueryDeviceState\fP or \fBGetDeviceMotionEvents\fP request.
  2826. .NH 2
  2827. DeviceValuator Event
  2828. .XS
  2829. \*(SN DeviceValuator Event
  2830. .XE
  2831. .LP
  2832. DeviceValuator
  2833. .LP
  2834. .in .5i
  2835. device: CARD8
  2836. .br
  2837. device_state: SETofKEYBUTMASK
  2838. .br
  2839. num_valuators: CARD8
  2840. .br
  2841. first_valuator: CARD8
  2842. .br
  2843. valuators: LISTofINT32
  2844. .TE
  2845. .in -.5i
  2846. .LP
  2847. DeviceValuator events are generated to contain valuator information for which
  2848. there is insufficient space in DeviceKey, DeviceButton, DeviceMotion, and
  2849. Proximity wire events.  For events of these types, a second event of type
  2850. DeviceValuator follows immediately.  The library combines these events into
  2851. a single event that a client can receive via XNextEvent.  DeviceValuator
  2852. events are not selected for by clients, they only exist to contain information
  2853. that will not fit into some event selected by clients.
  2854. .LP
  2855. The device_state component gives the state of the 
  2856. buttons and modifiers on the device generating the event.  
  2857. .LP
  2858. Extension motion devices may report motion data for a variable number of 
  2859. axes.  The valuators array contains the values of all axes reported by the
  2860. device.  If more than 6 axes are reported, more than one DeviceValuator event 
  2861. will be sent by the server, and more than one DeviceKey, DeviceButton,
  2862. DeviceMotion, or Proximity event will be reported by the library.  
  2863. Clients should examine the corresponding fields of the event reported by
  2864. the library to determine the total number of axes reported, and the first axis
  2865. reported in the current event.  Axes are numbered beginning with zero.
  2866. .LP
  2867. For Button, Key and Motion events on a device reporting absolute motion data
  2868. the current value of the device's valuators is reported.  For devices that
  2869. report relative data, Button and Key events may be followed by a DeviceValuator
  2870. event that contains 0s in the num_valuators field.   In this case, only the
  2871. device_state component will have meaning.
  2872. .NH 2
  2873. Device Focus Events
  2874. .XS
  2875. \*(SN Device Focus Events
  2876. .XE
  2877. .LP
  2878. DeviceFocusIn
  2879. .br
  2880. DeviceFocusOut
  2881. .LP
  2882. .in .5i
  2883. device: CARD8
  2884. .br
  2885. time: TIMESTAMP
  2886. .br
  2887. event: WINDOW
  2888. .br
  2889. mode: { Normal, WhileGrabbed, Grab, Ungrab}
  2890. .br
  2891. detail: { Ancestor, Virtual, Inferior, Nonlinear, NonlinearVirtual, Pointer, PointerRoot, None}
  2892. .br
  2893. .in -.5i
  2894. .LP
  2895. These events are generated when the input focus changes and are reported to 
  2896. clients selecting \fBDeviceFocusChange\fP for the specified device and window.
  2897. Events generated by \fBSetDeviceFocus\fP when the device is not grabbed
  2898. have mode \fBNormal\fP. Events generated by \fBSetDeviceFocus\fP when the 
  2899. device is grabbed have mode \fBWhileGrabbed\fP.  Events generated when a 
  2900. device grab actives have mode \fBGrab\fP, and events generated when a device
  2901. grab deactivates have mode \fBUngrab\fP.  
  2902. .LP
  2903. All \fBDeviceFocusOut\fP events caused by a window unmap are generated after 
  2904. any \fBUnmapNotify\fP event, but the ordering of \fBDeviceFocusOut\fP with
  2905. respect to generated \fBEnterNotify\fP, \fBLeaveNotify\fP, 
  2906. \fBVisibilityNotify\fP and \fBExpose\fP events is not constrained.
  2907. .LP
  2908. \fBDeviceFocusIn\fP and \fBDeviceFocusOut\fP events are generated for
  2909. focus changes of extension devices in the same manner as focus events for 
  2910. the core devices are generated.
  2911. .NH 2
  2912. Device State Notify Event
  2913. .XS
  2914. \*(SN Device State Notify Event
  2915. .XE
  2916. .LP
  2917. DeviceStateNotify
  2918. .LP
  2919. .in .5i
  2920. time: TIMESTAMP
  2921. .br
  2922. device: CARD8
  2923. .br
  2924. num_keys: CARD8
  2925. .br
  2926. num_buttons: CARD8
  2927. .br
  2928. num_valuators: CARD8
  2929. .br
  2930. classes_reported: CARD8 {SetOfDeviceMode | SetOfInputClass}
  2931. .in +.5i
  2932. .br
  2933. SetOfDeviceMode:
  2934. .in +.5i
  2935. .br
  2936. #x80 ProximityState
  2937. .in +.5i
  2938. .br
  2939. 0 = InProxmity, 1 = OutOfProximity
  2940. .in -.5i
  2941. .br
  2942. #x40 Device Mode
  2943. .in +.5i
  2944. .br
  2945. (0 = Relative, 1 = Absolute)
  2946. .br
  2947. .in -1.0i
  2948. SetOfInputClass:
  2949. .in +.5i
  2950. .br
  2951. #x04 reporting valuators
  2952. .br
  2953. #x02 reporting buttons
  2954. .br
  2955. #x01 reporting keys
  2956. .in -1.0i
  2957. .br
  2958. buttons: LISTofCARD8
  2959. .br
  2960. keys: LISTofCARD8
  2961. .br
  2962. valuators: LISTofCARD32
  2963. .br
  2964. .TE
  2965. .in -.5i
  2966. .LP
  2967. This event reports the state of the device just as in the 
  2968. \fBQueryDeviceState\fP request.  This event is reported to clients selecting 
  2969. \fBDeviceStateNotify\fP for the device and window and is generated immediately 
  2970. after every \fBEnterNotify\fP and \fBDeviceFocusIn\fP.  If the device has
  2971. no more than 32 buttons, no more than 32 keys, and no more than 3 valuators,
  2972. This event can report the state of the device.  If the device has more
  2973. than 32 buttons, the event will be immediately followed by a 
  2974. DeviceButtonStateNotify event.  If the device has more than 32 keys, the
  2975. event will be followed by a DeviceKeyStateNotify event.  If the device has more
  2976. than 3 valuators, the event will be followed by one or more DeviceValuator
  2977. events.
  2978. .NH 2
  2979. Device KeyState and ButtonState Notify Events
  2980. .XS
  2981. \*(SN Device KeyState and ButtonState Notify Events
  2982. .XE
  2983. .LP
  2984. DeviceKeyStateNotify
  2985. .LP
  2986. .in .5i
  2987. device: CARD8
  2988. .br
  2989. keys: LISTofCARD8
  2990. .in -.5i
  2991. .LP
  2992. DeviceButtonStateNotify
  2993. .LP
  2994. .in .5i
  2995. device: CARD8
  2996. .br
  2997. buttons: LISTofCARD8
  2998. .in -.5i
  2999. .LP
  3000. These events contain information about the state of keys and buttons on a 
  3001. device that will not fit into the DeviceStateNotify wire event.  These events
  3002. are not selected by clients, rather they may immediately follow a
  3003. DeviceStateNotify wire event and be combined with it into a single 
  3004. DeviceStateNotify client event that a client may receive via XNextEvent.
  3005. .NH 2
  3006. DeviceMappingNotify Event
  3007. .XS
  3008. \*(SN DeviceMappingNotify Event
  3009. .XE
  3010. .LP
  3011. DeviceMappingNotify
  3012. .LP
  3013. .in .5i
  3014. time: TIMESTAMP
  3015. .br
  3016. device: CARD8
  3017. .br
  3018. request: CARD8
  3019. .br
  3020. first_keycode: CARD8
  3021. .br
  3022. count: CARD8
  3023. .in -.5i
  3024. .LP
  3025. This event reports a change in the mapping of keys, modifiers, or buttons on
  3026. an extension device.  This event is reported to clients selecting 
  3027. \fBDeviceMappingNotify\fP for the device and window and is generated
  3028. after every client \fBSetDeviceButtonMapping\fP, \fBChangeDeviceKeyMapping\fP,
  3029. or  \fBChangeDeviceModifierMapping\fP request.
  3030. .NH 2
  3031. ChangeDeviceNotify Event
  3032. .XS
  3033. \*(SN ChangeDeviceNotify Event
  3034. .XE
  3035. .LP
  3036. ChangeDeviceNotify
  3037. .LP
  3038. .in .5i
  3039. device: CARD8
  3040. .br
  3041. time: TIMESTAMP
  3042. .br
  3043. request: CARD8
  3044. .in -.5i
  3045. .LP
  3046. This event reports a change in the physical device being used as the core
  3047. X keyboard or X pointer device.
  3048. \fBChangeDeviceNotify\fP events are reported to clients selecting 
  3049. \fBChangeDeviceNotify\fP for the device and window and is generated
  3050. after every client \fBChangeKeyboardDevice\fP
  3051. or  \fBChangePointerDevice\fP request.
  3052. .NH 2
  3053. Proximity Events
  3054. .XS
  3055. \*(SN Proximity Events
  3056. .XE
  3057. .LP
  3058. ProximityIn
  3059. .br
  3060. ProximityOut
  3061. .LP
  3062. .in .5i
  3063. device: CARD8
  3064. .br
  3065. root, event: WINDOW
  3066. .br
  3067. child: Window or None
  3068. .br
  3069. same-screen: BOOL
  3070. .br
  3071. root-x, root-y, event-x, event-y: INT16
  3072. .br
  3073. state: SETofKEYBUTMASK
  3074. .br
  3075. time: TIMESTAMP
  3076. .br
  3077. device-state: SETofKEYBUTMASK
  3078. .br
  3079. axis-count: CARD8
  3080. .br
  3081. first-axis: CARD8
  3082. .br
  3083. axis-data: LISTofINT32
  3084. .br
  3085. .in -.5i
  3086. .TE
  3087. .LP
  3088. These events are generated by some devices (such as graphics tablets or 
  3089. touchscreens) to indicate that a stylus has moved into or out of contact
  3090. with a positional sensing surface.
  3091. .LP
  3092. The ``source'' of the event is the window the pointer is in.
  3093. The window with respect to which the event is normally reported is found
  3094. by looking up the hierarchy (starting with the source window)
  3095. for the first window on which any client has selected interest in the event.
  3096. The actual window used for reporting can be modified by active grabs and
  3097. by the focus window.The window the event is reported with respect to is called
  3098. the ``event'' window.
  3099. .LP
  3100. The root is the root window of the ``source'' window, and root-x and root-y
  3101. are the pointer coordinates relative to root's origin at the time of the event.
  3102. Event is the ``event'' window.  If the event window is on the same screen as
  3103. root, then event-x and event-y are the pointer coordinates relative to the
  3104. event window's origin.  Otherwise, event-x and event-y are zero.  If the
  3105. source window is an inferior of the event window, then child is set to
  3106. the child of the event window that is an ancestor of (or is) the source window.
  3107. Otherwise, it is set to None. The state component gives the logical state of
  3108. the buttons on the core X pointer and modifier keys on the core X keyboard
  3109. just before the event.  The device-state component gives the state of the
  3110. buttons and modifiers on the device generating the event.
  3111. .bp
  3112.