home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 August - Disc 2 / chip_20018102_hu.iso / linux / X-4.1.0 / doc / XiPorting.TXT < prev    next >
Encoding:
Text File  |  2001-06-27  |  38.6 KB  |  1,651 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.         X11 Input Extension Porting Document
  19.  
  20.  
  21.          X Version 11, Release 6.4
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.           George Sachs    Hewlett-Packard
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85. Copyright (C) 1989, 1990, 1991 by Hewlett-Packard Company
  86.  
  87. Permission to use, copy, modify, and distribute this docu-
  88. mentation for any purpose and without fee is hereby granted,
  89. provided that the above copyright notice and this permission
  90. notice appear in all copies.  Hewlett-Packard makes no rep-
  91. resentations about the suitability for any purpose of the
  92. information in this document.  It is provided "as is" with-
  93. out express or implied warranty.  This document is only a
  94. draft standard of the X Consortium and is therefore subject
  95. to change.
  96.  
  97.  
  98.  
  99.  
  100.  
  101. Copyright (C) 1989, 1990, 1991 X Consortium
  102.  
  103. Permission is hereby granted, free of charge, to any person
  104. obtaining a copy of this software and associated documenta-
  105. tion files (the ``Software''), to deal in the Software with-
  106. out restriction, including without limitation the rights to
  107. use, copy, modify, merge, publish, distribute, sublicense,
  108. and/or sell copies of the Software, and to permit persons to
  109. whom the Software is furnished to do so, subject to the fol-
  110. lowing conditions:
  111.  
  112. The above copyright notice and this permission notice shall
  113. be included in all copies or substantial portions of the
  114. Software.
  115.  
  116. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY
  117. KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  118. WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PUR-
  119. POSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X CONSOR-
  120. TIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  121. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  122. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
  123. OR OTHER DEALINGS IN THE SOFTWARE.
  124.  
  125. Except as contained in this notice, the name of the X Con-
  126. sortium shall not be used in advertising or otherwise to
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. promote the sale, use or other dealings in this Software
  140. without prior written authorization from the X Consortium.
  141.  
  142.  
  143.  
  144. X Window System is a trademark of X Consortium, Inc.
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. This document is intended to aid the process of integrating
  206. the X11 Input Extension into an X server.
  207.  
  208. Most of the functionality provided by the input extension is
  209. device- and implementation-independent, and should require
  210. no changes.  The functionality is implemented by routines
  211. that typically reside in the server source tree directory
  212. extensions/server/xinput.  This extension includes functions
  213. to enable and disable input extension devices, select input,
  214. grab and focus those device, query and change key and button
  215. mappings, and others.  The only input extension requirements
  216. for the device-dependent part of X are that the input
  217. devices be correctly initialized and input events from those
  218. devices be correctly generated.  Device-dependent X is
  219. responsible for reading input data from the input device
  220. hardware and if necessary, reformatting it into X events.
  221.  
  222. The process of initializing input extension devices is simi-
  223. lar to that used for the core devices, and is described in
  224. the following sections.  When multiple input devices are
  225. attached to X server, the choice of which devices to ini-
  226. tially use as the core X pointer and keyboard is left imple-
  227. mentation-dependent.  It is also up to each implementation
  228. to decide whether all input devices will be opened by the
  229. server during its initialization and kept open for the life
  230. of the server.    The alternative is to open only the X key-
  231. board and X pointer during server initialization, and open
  232. other input devices only when requested by a client to do
  233. so.  Either type of implementation is supported by the input
  234. extension.
  235.  
  236. Input extension events generated by the X server use the
  237. same 32-byte xEvent wire event as do core input events.
  238. However, additional information must be sent for input
  239. extension devices, requiring that multiple xEvents be gener-
  240. ated each time data is received from an input extension
  241. device.  These xEvents are combined into a single client
  242. XEvent by the input extension library.    A later section of
  243. this document describes the format and generation of input
  244. extension events.
  245.  
  246. 1.  Initializing Extension Devices
  247.  
  248. Extension input devices are initialized in the same manner
  249. as the core X input devices.  Device-Independent X provides
  250. functions that can be called from DDX to initialize these
  251. devices.  Which functions are called and when will vary by
  252. implementation, and will depend on whether the implementa-
  253. tion opens all the input devices available to X when X is
  254. initialized, or waits until a client requests that a device
  255. be opened.  In the simplest case, DDX will open all input
  256. devices as part of its initialization, when the InitInput
  257. routine is called.
  258.  
  259.  
  260.  
  261.  
  262.                   1
  263.  
  264.  
  265.  
  266.  
  267.  
  268. X Input Extension Porting Document        X11, Release 6.4
  269.  
  270.  
  271. 1.1.  Summary of Calling Sequence
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                   2
  329.  
  330.  
  331.  
  332.  
  333.  
  334. X Input Extension Porting Document        X11, Release 6.4
  335.  
  336.  
  337.      Device-Independent X    |  Device-Dependent X
  338.      --------------------    |  -------------------
  339.                 |
  340.      InitInput -------------->    |  - do device-specific initialization
  341.                 |
  342.                 |  - call AddInputDevice  (deviceProc,AutoStart)
  343.      AddInputDevice        |
  344.        - creates DeviceIntRec    |
  345.        - records deviceProc    |
  346.        - adds new device to    |
  347.      list of off_devices.    |
  348.      sets dev->startup=AutoStart|
  349.                 |  - call one of:
  350.                 |    - RegisterPointerDevice (X pointer)
  351.                 |      - processInputProc = ProcessPointerEvents
  352.                 |    - RegisterKeyboardDevice (X keyboard)
  353.                 |      - processInputProc = ProcessKeyboardEvents
  354.                 |    - RegisterOtherDevice  (extension device)
  355.                 |      - processInputProc = ProcessOtherEvents
  356.                 |
  357.                 |
  358.      InitAndStartDevices -----> |  - calls deviceProc with parameters
  359.                 |    (DEVICE_INIT, AutoStart)
  360.      sets dev->inited = return    |
  361.        value from deviceProc    |
  362.                 |
  363.                 |  - in deviceProc, do one of:
  364.                 |    - call InitPointerDeviceStruct (X pointer)
  365.                 |    - call InitKeyboardDeviceStruct (X keybd)
  366.                 |    - init extension device by calling some of:
  367.                 |      - InitKeyClassDeviceStruct
  368.                 |      - InitButtonClassDeviceStruct
  369.                 |      - InitValuatorClassDeviceStruct
  370.                 |      - InitValuatorAxisStruct
  371.                 |      - InitFocusClassDeviceStruct
  372.                 |      - InitProximityClassDeviceStruct
  373.                 |      - InitKbdFeedbackClassDeviceStruct
  374.                 |      - InitPtrFeedbackClassDeviceStruct
  375.                 |      - InitLedFeedbackClassDeviceStruct
  376.                 |      - InitStringFeedbackClassDeviceStruct
  377.                 |      - InitIntegerFeedbackClassDeviceStruct
  378.                 |      - InitBellFeedbackClassDeviceStruct
  379.                 |    - init device name and type by:
  380.                 |      - calling MakeAtom with one of the
  381.                 |     predefined names
  382.                 |      - calling AssignTypeAndName
  383.                 |
  384.                 |
  385.      for each device added    |
  386.      by AddInputDevice,    |
  387.      InitAndStartDevices    |
  388.      calls EnableDevice if    |  - EnableDevice calls deviceProc with
  389.      dev->startup &     |    (DEVICE_ON, AutoStart)
  390.      dev->inited        |
  391.  
  392.  
  393.  
  394.                   3
  395.  
  396.  
  397.  
  398.  
  399.  
  400. X Input Extension Porting Document        X11, Release 6.4
  401.  
  402.  
  403.                 |
  404.      If deviceProc returns    |  - core devices are now enabled, extension
  405.      Success, EnableDevice    |    devices are now available to be accessed
  406.      move the device from    |    through the input extension protocol
  407.      inputInfo.off_devices    |    requests.
  408.      to inputInfo.devices    |
  409.  
  410.  
  411. 1.2.  Initialization Called From InitInput
  412.  
  413. InitInput is the first DDX input entry point called during X
  414. server startup.  This routine is responsible for device- and
  415. implementation- specific initialization, and for calling
  416. AddInputDevice to create and initialize the DeviceIntRec
  417. structure for each input device.  AddInputDevice is passed
  418. the address of a procedure to be called by the DIX routine
  419. InitAndStartDevices when input devices are enabled.  This
  420. procedure is expected to perform X initialization for the
  421. input device.
  422.  
  423. If the device is to be used as the X pointer, DDX should
  424. then call RegisterPointerDevice, passing the DeviceIntRec
  425. pointer, to initialize the device as the X pointer.
  426.  
  427. If the device is to be used as the X keyboard, DDX should
  428. instead call RegisterKeyboardDevice to initialize the device
  429. as the X keyboard.
  430.  
  431. If the device is to be used as an extension device, DDX
  432. should instead call RegisterOtherDevice, passing the Devi-
  433. ceIntPtr returned by AddInputDevice.
  434.  
  435. A sample InitInput implementation is shown below.
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.                   4
  461.  
  462.  
  463.  
  464.  
  465.  
  466. X Input Extension Porting Document        X11, Release 6.4
  467.  
  468.  
  469.      InitInput(argc,argv)
  470.      {
  471.      int i, numdevs, ReadInput();
  472.      DeviceIntPtr dev;
  473.      LocalDevice localdevs[LOCAL_MAX_DEVS];
  474.      DeviceProc kbdproc, ptrproc, extproc;
  475.  
  476.      /**************************************************************
  477.       * Open the appropriate input devices, determine which are
  478.       * available, and choose an X pointer and X keyboard device
  479.       * in some implementation-dependent manner.
  480.       ***************************************************************/
  481.  
  482.      open_input_devices (&numdevs, localdevs);
  483.  
  484.      /**************************************************************
  485.       * Register a WakeupHandler to handle input when it is generated.
  486.       ***************************************************************/
  487.  
  488.      RegisterBlockAndWakeupHandlers (NoopDDA, ReadInput, NULL);
  489.  
  490.      /**************************************************************
  491.       * Register the input devices with DIX.
  492.       ***************************************************************/
  493.  
  494.      for (i=0; i<numdevs; i++)
  495.          {
  496.          if (localdevs[i].use == IsXKeyboard)
  497.          {
  498.          dev = AddInputDevice (kbdproc, TRUE);
  499.          RegisterKeyboardDevice (dev);
  500.          }
  501.          else if (localdevs[i].use == IsXPointer)
  502.          {
  503.          dev = AddInputDevice (ptrproc, TRUE);
  504.          RegisterPointerDevice (dev);
  505.          }
  506.          else
  507.          {
  508.          dev = AddInputDevice (extproc, FALSE);
  509.          RegisterOtherDevice (dev);
  510.          }
  511.          if (dev == NULL)
  512.          FatalError ("Too many input devices.");
  513.          dev->devicePrivate = (pointer) &localdevs[i];
  514.          }
  515.  
  516.  
  517. 1.3.  Initialization Called From InitAndStartDevices
  518.  
  519. After InitInput has returned, InitAndStartDevices is the DIX
  520. routine that is called to enable input devices.  It calls
  521. the device control routine that was passed to AddInputDe-
  522. vice, with a mode value of DEVICE_INIT.  The action taken by
  523.  
  524.  
  525.  
  526.                   5
  527.  
  528.  
  529.  
  530.  
  531.  
  532. X Input Extension Porting Document        X11, Release 6.4
  533.  
  534.  
  535. the device control routine depends on how the device is to
  536. be used.  If the device is to be the X pointer, the device
  537. control routine should call InitPointerDeviceStruct to ini-
  538. tialize it.  If the device is to be the X keyboard, the
  539. device control routine should call InitKeyboardDeviceStruct.
  540. Since input extension devices may support various combina-
  541. tions of keys, buttons, valuators, and feedbacks, each class
  542. of input that it supports must be initialized.    Entry points
  543. are defined by DIX to initialize each of the supported
  544. classes of input, and are described in the following sec-
  545. tions.
  546.  
  547. A sample device control routine called from InitAndStartDe-
  548. vices is shown below.
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.                   6
  593.  
  594.  
  595.  
  596.  
  597.  
  598. X Input Extension Porting Document        X11, Release 6.4
  599.  
  600.  
  601.      Bool extproc (dev, mode)
  602.      DeviceIntPtr dev;
  603.      int mode;
  604.      {
  605.      LocalDevice *localdev = (LocalDevice *) dev->devicePrivate;
  606.  
  607.      switch (mode)
  608.          {
  609.          case DEVICE_INIT:
  610.          if (strcmp(localdev->name, XI_TABLET) == 0)
  611.              {
  612.              /****************************************************
  613.               * This device reports proximity, has buttons,
  614.               * reports two axes of motion, and can be focused.
  615.               * It also supports the same feedbacks as the X pointer
  616.               * (acceleration and threshold can be set).
  617.               ****************************************************/
  618.  
  619.              InitButtonClassDeviceStruct (dev, button_count, button_map);
  620.              InitValuatorClassDeviceStruct (dev, localdev->n_axes,);
  621.              motionproc, MOTION_BUF_SIZE, Absolute);
  622.              for (i=0; i<localdev->n_axes; i++)
  623.              InitValuatorAxisStruct (dev, i, min_val, max_val,
  624.                  resolution);
  625.              InitFocusClassDeviceStruct (dev);
  626.              InitProximityClassDeviceStruct (dev);
  627.              InitPtrFeedbackClassDeviceStruct (dev, p_controlproc);
  628.              }
  629.          else if (strcmp(localdev->name, XI_BUTTONBOX) == 0)
  630.              {
  631.              /****************************************************
  632.               * This device has keys and LEDs, and can be focused.
  633.               ****************************************************/
  634.  
  635.              InitKeyClassDeviceStruct (dev, syms, modmap);
  636.              InitFocusClassDeviceStruct (dev);
  637.              InitLedFeedbackClassDeviceStruct (dev, ledcontrol);
  638.              }
  639.          else if (strcmp(localdev->name, XI_KNOBBOX) == 0)
  640.              {
  641.              /****************************************************
  642.               * This device reports motion.
  643.               * It can be focused.
  644.               ****************************************************/
  645.  
  646.              InitValuatorClassDeviceStruct (dev, localdev->n_axes,);
  647.              motionproc, MOTION_BUF_SIZE, Absolute);
  648.              for (i=0; i<localdev->n_axes; i++)
  649.              InitValuatorAxisStruct (dev, i, min_val, max_val,
  650.                  resolution);
  651.              InitFocusClassDeviceStruct (dev);
  652.              }
  653.          localdev->atom =
  654.              MakeAtom(localdev->name, strlen(localdev->name), FALSE);
  655.  
  656.  
  657.  
  658.                   7
  659.  
  660.  
  661.  
  662.  
  663.  
  664. X Input Extension Porting Document        X11, Release 6.4
  665.  
  666.  
  667.          AssignTypeAndName (dev, localdev->atom, localdev->name);
  668.          break;
  669.          case DEVICE_ON:
  670.          AddEnabledDevice (localdev->file_ds);
  671.          dev->on = TRUE;
  672.          break;
  673.          case DEVICE_OFF:
  674.          dev->on = FALSE;
  675.          RemoveEnabledDevice (localdev->file_ds);
  676.          break;
  677.          case DEVICE_CLOSE:
  678.          break;
  679.          }
  680.      }
  681.  
  682.  
  683. The device control routine is called with a mode value of
  684. DEVICE_ON by the DIX routine EnableDevice, which is called
  685. from InitAndStartDevices.  When called with this mode, it
  686. should call AddEnabledDevice to cause the server to begin
  687. checking for available input from this device.
  688.  
  689. >From InitAndStartDevices, EnableDevice is called for all
  690. devices that have the "inited" and "startup" fields in the
  691. DeviceIntRec set to TRUE.  The "inited" field is set by Ini-
  692. tAndStartDevices to the value returned by the deviceproc
  693. when called with a mode value of DEVICE_INIT.  The "startup"
  694. field is set by AddInputDevice to value of the second param-
  695. eter (autoStart).
  696.  
  697. When the server is first initialized, it should only be
  698. checking for input from the core X keyboard and pointer.
  699. One way to accomplish this is to call AddInputDevice for the
  700. core X keyboard and pointer with an autoStart value equal to
  701. TRUE, while calling AddInputDevice for input extension
  702. devices with an autoStart value equal to FALSE.  If this is
  703. done, EnableDevice will skip all input extension devices
  704. during server initialization.  In this case, the OpenInput-
  705. Device routine should set the "startup" field to TRUE when
  706. called for input extension devices.  This will cause ProcX-
  707. OpenInputDevice to call EnableDevice for those devices when
  708. a client first does an XOpenDevice request.
  709.  
  710. 1.4.  DIX Input Class Initialization Routines
  711.  
  712. DIX routines are defined to initialize each of the defined
  713. input classes.    The defined classes are:
  714.  
  715.      -    KeyClass - the device has keys.
  716.  
  717.      -    ButtonClass - the device has buttons.
  718.  
  719.      -    ValuatorClass - the device reports motion data or
  720.     positional data.
  721.  
  722.  
  723.  
  724.                   8
  725.  
  726.  
  727.  
  728.  
  729.  
  730. X Input Extension Porting Document        X11, Release 6.4
  731.  
  732.  
  733.      -    Proximitylass - the device reports proximity infor-
  734.     mation.
  735.  
  736.      -    FocusClass - the device can be focused.
  737.  
  738.      -    FeedbackClass - the device supports some kind of
  739.     feedback
  740.  
  741. DIX routines are provided to initialize the X pointer and
  742. keyboard, as in previous releases of X.  During X initial-
  743. ization, InitPointerDeviceStruct is called to initialize the
  744. X pointer, and InitKeyboardDeviceStruct is called to ini-
  745. tialize the X keyboard.  There is no corresponding routine
  746. for extension input devices, since they do not all support
  747. the same classes of input.  Instead, DDX is responsible for
  748. the initialization of the input classes supported by exten-
  749. sion devices.  A description of the routines provided by DIX
  750. to perform that initialization follows.
  751.  
  752. 1.4.1.    InitKeyClassDeviceStruct
  753.  
  754. This function is provided to allocate and initialize a Key-
  755. ClassRec, and should be called for extension devices that
  756. have keys.  It is passed a pointer to the device, and point-
  757. ers to arrays of keysyms and modifiers reported by the
  758. device.  It returns FALSE if the KeyClassRec could not be
  759. allocated, or if the maps for the keysyms and and modifiers
  760. could not be allocated.  Its parameters are:
  761.  
  762.  
  763.      Bool
  764.      InitKeyClassDeviceStruct(dev, pKeySyms, pModifiers)
  765.      DeviceIntPtr dev;
  766.      KeySymsPtr pKeySyms;
  767.      CARD8 pModifiers[];
  768.  
  769.  
  770. The DIX entry point InitKeyboardDeviceStruct calls this rou-
  771. tine for the core X keyboard.  It must be called explicitly
  772. for extension devices that have keys.
  773.  
  774. 1.4.2.    InitButtonClassDeviceStruct
  775.  
  776. This function is provided to allocate and initialize a But-
  777. tonClassRec, and should be called for extension devices that
  778. have buttons.  It is passed a pointer to the device, the
  779. number of buttons supported, and a map of the reported but-
  780. ton codes.  It returns FALSE if the ButtonClassRec could not
  781. be allocated.  Its parameters are:
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.                   9
  791.  
  792.  
  793.  
  794.  
  795.  
  796. X Input Extension Porting Document        X11, Release 6.4
  797.  
  798.  
  799.      Bool
  800.      InitButtonClassDeviceStruct(dev, numButtons, map)
  801.      register DeviceIntPtr dev;
  802.      int numButtons;
  803.      CARD8 *map;
  804.  
  805.  
  806. The DIX entry point InitPointerDeviceStruct calls this rou-
  807. tine for the core X pointer.  It must be called explicitly
  808. for extension devices that have buttons.
  809.  
  810. 1.4.3.    InitValuatorClassDeviceStruct
  811.  
  812. This function is provided to allocate and initialize a Valu-
  813. atorClassRec, and should be called for extension devices
  814. that have valuators.  It is passed the number of axes of
  815. motion reported by the device, the address of the motion
  816. history procedure for the device, the size of the motion
  817. history buffer, and the mode (Absolute or Relative) of the
  818. device.  It returns FALSE if the ValuatorClassRec could not
  819. be allocated.  Its parameters are:
  820.  
  821.  
  822.      Bool
  823.      InitValuatorClassDeviceStruct(dev, numAxes, motionProc, numMotionEvents, mode)
  824.      DeviceIntPtr dev;
  825.      int (*motionProc)();
  826.      int numAxes;
  827.      int numMotionEvents;
  828.      int mode;
  829.  
  830.  
  831. The DIX entry point InitPointerDeviceStruct calls this rou-
  832. tine for the core X pointer.  It must be called explicitly
  833. for extension devices that report motion.
  834.  
  835. 1.4.4.    InitValuatorAxisStruct
  836.  
  837. This function is provided to initialize an XAxisInfoRec, and
  838. should be called for core and extension devices that have
  839. valuators.  The space for the XAxisInfoRec is allocated by
  840. the InitValuatorClassDeviceStruct function, but is not ini-
  841. tialized.
  842.  
  843. InitValuatorAxisStruct should be called once for each axis
  844. of motion reported by the device.  Each invocation should be
  845. passed the axis number (starting with 0), the minimum value
  846. for that axis, the maximum value for that axis, and the res-
  847. olution of the device in counts per meter.  If the device
  848. reports relative motion, 0 should be reported as the minimum
  849. and maximum values.  InitValuatorAxisStruct has the follow-
  850. ing parameters:
  851.  
  852.  
  853.  
  854.  
  855.  
  856.                  10
  857.  
  858.  
  859.  
  860.  
  861.  
  862. X Input Extension Porting Document        X11, Release 6.4
  863.  
  864.  
  865.      InitValuatorAxisStruct(dev, axnum, minval, maxval, resolution)
  866.      DeviceIntPtr dev;
  867.      int axnum;
  868.      int minval;
  869.      int maxval;
  870.      int resolution;
  871.  
  872.  
  873. This routine is not called by InitPointerDeviceStruct for
  874. the core X pointer.  It must be called explicitly for core
  875. and extension devices that report motion.
  876.  
  877. 1.4.5.    InitFocusClassDeviceStruct
  878.  
  879. This function is provided to allocate and initialize a
  880. FocusClassRec, and should be called for extension devices
  881. that can be focused.  It is passed a pointer to the device,
  882. and returns FALSE if the allocation fails.  It has the fol-
  883. lowing parameter:
  884.  
  885.      Bool
  886.      InitFocusClassDeviceStruct(dev)
  887.      DeviceIntPtr dev;
  888.  
  889.  
  890. The DIX entry point InitKeyboardDeviceStruct calls this rou-
  891. tine for the core X keyboard.  It must be called explicitly
  892. for extension devices that can be focused.  Whether or not a
  893. particular device can be focused is left implementation-
  894. dependent.
  895.  
  896. 1.4.6.    InitProximityClassDeviceStruct
  897.  
  898. This function is provided to allocate and initialize a Prox-
  899. imityClassRec, and should be called for extension absolute
  900. pointing devices that report proximity.  It is passed a
  901. pointer to the device, and returns FALSE if the allocation
  902. fails.    It has the following parameter:
  903.  
  904.      Bool
  905.      InitProximityClassDeviceStruct(dev)
  906.      DeviceIntPtr dev;
  907.  
  908.  
  909. 1.4.7.    Initializing Feedbacks
  910.  
  911.  
  912. 1.4.7.1.  InitKbdFeedbackClassDeviceStruct
  913.  
  914. This function is provided to allocate and initialize a Kbd-
  915. FeedbackClassRec, and may be called for extension devices
  916. that support some or all of the feedbacks that the core key-
  917. board supports.  It is passed a pointer to the device, a
  918. pointer to the procedure that sounds the bell, and a pointer
  919.  
  920.  
  921.  
  922.                  11
  923.  
  924.  
  925.  
  926.  
  927.  
  928. X Input Extension Porting Document        X11, Release 6.4
  929.  
  930.  
  931. to the device control procedure.  It returns FALSE if the
  932. allocation fails, and has the following parameters:
  933.  
  934.      Bool
  935.      InitKbdFeedbackClassDeviceStruct(dev, bellProc, controlProc)
  936.      DeviceIntPtr dev;
  937.      void (*bellProc)();
  938.      void (*controlProc)();
  939.  
  940. The DIX entry point InitKeyboardDeviceStruct calls this rou-
  941. tine for the core X keyboard.  It must be called explicitly
  942. for extension devices that have the same feedbacks as a key-
  943. board.    Some feedbacks, such as LEDs and bell, can be sup-
  944. ported either with a KbdFeedbackClass or with BellFeedback-
  945. Class and LedFeedbackClass feedbacks.
  946.  
  947. 1.4.7.2.  InitPtrFeedbackClassDeviceStruct
  948.  
  949. This function is provided to allocate and initialize a Ptr-
  950. FeedbackClassRec, and should be called for extension devices
  951. that allow the setting of acceleration and threshold.  It is
  952. passed a pointer to the device, and a pointer to the device
  953. control procedure.  It returns FALSE if the allocation
  954. fails, and has the following parameters:
  955.  
  956.      Bool
  957.      InitPtrFeedbackClassDeviceStruct(dev, controlProc)
  958.      DeviceIntPtr dev;
  959.      void (*controlProc)();
  960.  
  961.  
  962. The DIX entry point InitPointerDeviceStruct calls this rou-
  963. tine for the core X pointer.  It must be called explicitly
  964. for extension devices that support the setting of accelera-
  965. tion and threshold.
  966.  
  967. 1.4.7.3.  InitLedFeedbackClassDeviceStruct
  968.  
  969. This function is provided to allocate and initialize a Led-
  970. FeedbackClassRec, and should be called for extension devices
  971. that have LEDs.  It is passed a pointer to the device, and a
  972. pointer to the device control procedure.  It returns FALSE
  973. if the allocation fails, and has the following parameters:
  974.  
  975.      Bool
  976.      InitLedFeedbackClassDeviceStruct(dev, controlProc)
  977.      DeviceIntPtr dev;
  978.      void (*controlProc)();
  979.  
  980.  
  981. Up to 32 LEDs per feedback can be supported, and a device
  982. may have multiple feedbacks of the same type.
  983.  
  984.  
  985.  
  986.  
  987.  
  988.                  12
  989.  
  990.  
  991.  
  992.  
  993.  
  994. X Input Extension Porting Document        X11, Release 6.4
  995.  
  996.  
  997. 1.4.7.4.  InitBellFeedbackClassDeviceStruct
  998.  
  999. This function is provided to allocate and initialize a
  1000. BellFeedbackClassRec, and should be called for extension
  1001. devices that have a bell.  It is passed a pointer to the
  1002. device, and a pointer to the device control procedure.    It
  1003. returns FALSE if the allocation fails, and has the following
  1004. parameters:
  1005.  
  1006.      Bool
  1007.      InitBellFeedbackClassDeviceStruct(dev, bellProc, controlProc)
  1008.      DeviceIntPtr dev;
  1009.      void (*bellProc)();
  1010.      void (*controlProc)();
  1011.  
  1012.  
  1013. 1.4.7.5.  InitStringFeedbackClassDeviceStruct
  1014.  
  1015. This function is provided to allocate and initialize a
  1016. StringFeedbackClassRec, and should be called for extension
  1017. devices that have a display upon which a string can be dis-
  1018. played.  It is passed a pointer to the device, and a pointer
  1019. to the device control procedure.  It returns FALSE if the
  1020. allocation fails, and has the following parameters:
  1021.  
  1022.      Bool
  1023.      InitStringFeedbackClassDeviceStruct(dev, controlProc, max_symbols,
  1024.       num_symbols_supported, symbols)
  1025.      DeviceIntPtr dev;
  1026.      void (*controlProc)();
  1027.      int max_symbols:
  1028.      int num_symbols_supported;
  1029.      KeySym *symbols;
  1030.  
  1031.  
  1032. 1.4.7.6.  InitIntegerFeedbackClassDeviceStruct
  1033.  
  1034. This function is provided to allocate and initialize an
  1035. IntegerFeedbackClassRec, and should be called for extension
  1036. devices that have a display upon which an integer can be
  1037. displayed.  It is passed a pointer to the device, and a
  1038. pointer to the device control procedure.  It returns FALSE
  1039. if the allocation fails, and has the following parameters:
  1040.  
  1041.      Bool
  1042.      InitIntegerFeedbackClassDeviceStruct(dev, controlProc)
  1043.      DeviceIntPtr dev;
  1044.      void (*controlProc)();
  1045.  
  1046.  
  1047. 1.5.  Initializing The Device Name And Type
  1048.  
  1049. The device name and type can be initialized by calling
  1050. AssignTypeAndName with the following parameters:
  1051.  
  1052.  
  1053.  
  1054.                  13
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. X Input Extension Porting Document        X11, Release 6.4
  1061.  
  1062.  
  1063.      void
  1064.      AssignTypeAndName(dev, type, name)
  1065.      DeviceIntPtr dev;
  1066.      Atom type;
  1067.      char *name;
  1068.  
  1069.  
  1070. This will allocate space for the device name and copy the
  1071. name that was passed.  The device type can be obtained by
  1072. calling MakeAtom with one of the names defined for input
  1073. devices.  MakeAtom has the following parameters:
  1074.  
  1075.      Atom
  1076.      MakeAtom(name, len, makeit)
  1077.      char *name;
  1078.      int len;
  1079.      Bool makeit;
  1080.  
  1081.  
  1082. Since the atom was already made when the input extension was
  1083. initialized, the value of makeit should be FALSE;
  1084.  
  1085. 2.  Closing Extension Devices
  1086.  
  1087. The DisableDevice entry point is provided by DIX to disable
  1088. input devices.    It calls the device control routine for the
  1089. specified device with a mode value of DEVICE_OFF.  The
  1090. device control routine should call RemoveEnabledDevice to
  1091. stop the server from checking for input from that device.
  1092.  
  1093. DisableDevice is not called by any input extension routines.
  1094. It can be called from the CloseInputDevice routine, which is
  1095. called by ProcXCloseDevice when a client makes an XCloseDe-
  1096. vice request.  If DisableDevice is called, it should only be
  1097. called when the last client using the extension device has
  1098. terminated or called XCloseDevice.
  1099.  
  1100. 3.  Implementation-Dependent Routines
  1101.  
  1102. Several input extension protocol requests have implementa-
  1103. tion-dependent    entry points.  Default routines are defined
  1104. for these entry points and contained in the source file
  1105. extensions/server/xinput/xstubs.c.  Some implementations may
  1106. be able to use the default routines without change.  The
  1107. following sections describe each of these routines.
  1108.  
  1109. 3.1.  AddOtherInputDevices
  1110.  
  1111. AddOtherInputDevice is called from ProcXListInputDevices as
  1112. a result of an XListInputDevices protocol request.  It may
  1113. be needed by implementations that do not open extension
  1114. input devices until requested to do so by some client.
  1115. These implementations may not initialize all devices when
  1116. the X server starts up, because some of those devices may be
  1117.  
  1118.  
  1119.  
  1120.                  14
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. X Input Extension Porting Document        X11, Release 6.4
  1127.  
  1128.  
  1129. in use.  Since the XListInputDevices function only lists
  1130. those devices that have been initialized, AddOtherInputDe-
  1131. vices is called to give DDX a chance to initialize any pre-
  1132. viously unavailable input devices.
  1133.  
  1134. A sample AddOtherInputDevices routine might look like the
  1135. following:
  1136.  
  1137.      void
  1138.      AddOtherInputDevices ()
  1139.      {
  1140.      DeviceIntPtr dev;
  1141.      int i;
  1142.  
  1143.      for (i=0; i<MAX_DEVICES; i++)
  1144.          {
  1145.          if (!local_dev[i].initialized && available(local_dev[i]))
  1146.          {
  1147.          dev = (DeviceIntPtr) AddInputDevice (local_dev[i].deviceProc, TRUE);
  1148.          dev->public.devicePrivate = local_dev[i];
  1149.          RegisterOtherDevice (dev);
  1150.          dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
  1151.          }
  1152.          }
  1153.      }
  1154.  
  1155.  
  1156. The default AddOtherInputDevices routine in xstubs.c does
  1157. nothing.  If all input extension devices are initialized
  1158. when the server starts up, it can be left as a null routine.
  1159.  
  1160. 3.2.  OpenInputDevice
  1161.  
  1162. Some X server implementations open all input devices when
  1163. the server is initialized and never close them.  Other
  1164. implementations may open only the X pointer and keyboard
  1165. devices during server initialization, and open other input
  1166. devices only when some client makes an XOpenDevice request.
  1167. This entry point is for the latter type of implementation.
  1168.  
  1169. If the physical device is not already open, it can be done
  1170. in this routine.  In this case, the server must keep track
  1171. of the fact that one or more clients have the device open,
  1172. and physically close it when the last client that has it
  1173. open makes an XCloseDevice request.
  1174.  
  1175. The default implementation is to do nothing (assume all
  1176. input devices are opened during X server initialization and
  1177. kept open).
  1178.  
  1179. 3.3.  CloseInputDevice
  1180.  
  1181. Some implementations may close an input device when the last
  1182. client using that device requests that it be closed, or
  1183.  
  1184.  
  1185.  
  1186.                  15
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. X Input Extension Porting Document        X11, Release 6.4
  1193.  
  1194.  
  1195. terminates.  CloseInputDevice is called from ProcXCloseDe-
  1196. vice when a client makes an XCloseDevice protocol request.
  1197.  
  1198. The default implementation is to do nothing (assume all
  1199. input devices are opened during X server initialization and
  1200. kept open).
  1201.  
  1202. 3.4.  SetDeviceMode
  1203.  
  1204. Some implementations support input devices that can report
  1205. either absolute positional data or relative motion.  The
  1206. XSetDeviceMode protocol request is provided to allow DDX to
  1207. change the current mode of such a device.
  1208.  
  1209. The default implementation is to always return a BadMatch
  1210. error.    If the implementation does not support any input
  1211. devices that are capable of reporting both relative motion
  1212. and absolute position information, the default implementa-
  1213. tion may be left unchanged.
  1214.  
  1215. 3.5.  SetDeviceValuators
  1216.  
  1217. Some implementations support input devices that allow their
  1218. valuators to be set to an initial value.  The XSetDeviceVal-
  1219. uators protocol request is provided to allow DDX to set the
  1220. valuators of such a device.
  1221.  
  1222. The default implementation is to always return a BadMatch
  1223. error.    If the implementation does not support any input
  1224. devices that are allow their valuators to be set, the
  1225. default implementation may be left unchanged.
  1226.  
  1227. 3.6.  ChangePointerDevice
  1228.  
  1229. The XChangePointerDevice protocol request is provided to
  1230. change which device is used as the X pointer.  Some imple-
  1231. mentations may maintain information specific to the X
  1232. pointer in the private data structure pointed to by the
  1233. DeviceIntRec.  ChangePointerDevice is called to allow such
  1234. implementations to move that information to the new pointer
  1235. device.  The current location of the X cursor is an example
  1236. of the type of information that might be affected.
  1237.  
  1238. The DeviceIntRec structure that describes the X pointer
  1239. device does not contain a FocusRec.  If the device that has
  1240. been made into the new X pointer was previously a device
  1241. that could be focused, ProcXChangePointerDevice will free
  1242. the FocusRec associated with that device.
  1243.  
  1244. If the server implementation desires to allow clients to
  1245. focus the old pointer device (which is now accessible
  1246. through the input extension), it should call InitFocusClass-
  1247. DeviceStruct for the old pointer device.
  1248.  
  1249.  
  1250.  
  1251.  
  1252.                  16
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. X Input Extension Porting Document        X11, Release 6.4
  1259.  
  1260.  
  1261. The XChangePointerDevice protocol request also allows the
  1262. client to choose which axes of the new pointer device are
  1263. used to move the X cursor in the X- and Y- directions.    If
  1264. the axes are different than the default ones, the server
  1265. implementation should record that fact.
  1266.  
  1267. If the server implementation supports input devices with
  1268. valuators that are not allowed to be used as the X pointer,
  1269. they should be screened out by this routine and a  BadDevice
  1270. error returned.
  1271.  
  1272. The default implementation is to do nothing.
  1273.  
  1274. 3.7.  ChangeKeyboardDevice
  1275.  
  1276. The XChangeKeyboardDevice protocol request is provided to
  1277. change which device is used as the X keyboard.    Some imple-
  1278. mentations may maintain information specific to the X key-
  1279. board in the private data structure pointed to by the Devi-
  1280. ceIntRec.  ChangeKeyboardDevice is called to allow such
  1281. implementations to move that information to the new keyboard
  1282. device.
  1283.  
  1284. The X keyboard device can be focused, and the DeviceIntRec
  1285. that describes that device has a FocusRec.  If the device
  1286. that has been made into the new X keyboard did not previ-
  1287. ously have a FocusRec, ProcXChangeKeyboardDevice will allo-
  1288. cate one for it.
  1289.  
  1290. If the implementation does not want clients to be able to
  1291. focus the old X keyboard (which has now become available as
  1292. an input extension device) it should call DeleteFocusClass-
  1293. DeviceStruct to free the FocusRec.
  1294.  
  1295. If the implementation supports input devices with keys that
  1296. are not allowed to be used as the X keyboard, they should be
  1297. checked for here, and a BadDevice error returned.
  1298.  
  1299. The default implementation is to do nothing.
  1300.  
  1301. 4.  Input Extension Events
  1302.  
  1303. Events accessed through the input extension are analogous to
  1304. the core input events, but have different event types.    They
  1305. are of types DeviceKeyPress, DeviceKeyRelease, DeviceButton-
  1306. Press, DeviceButtonRelease, DeviceDeviceMotionNotify, Devi-
  1307. ceProximityIn, DeviceProximityOut, and DeviceValuator.
  1308. These event types are not constants.  Instead, they are
  1309. external integers defined by the input extension.  Their
  1310. actual values will depend on which extensions are supported
  1311. by a server, and the order in which they are initialized.
  1312.  
  1313. The data structures that define these events are defined in
  1314. the file extensions/include/XIproto.h.    Other input
  1315.  
  1316.  
  1317.  
  1318.                  17
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. X Input Extension Porting Document        X11, Release 6.4
  1325.  
  1326.  
  1327. extension constants needed by DDX are defined in the file
  1328. extensions/include/XI.h.
  1329.  
  1330. Some events defined by the input extension contain more
  1331. information than can be contained in the 32-byte xEvent data
  1332. structure.  To send this information to clients, DDX must
  1333. generate two or more 32-byte wire events.  The following
  1334. sections describe the contents of these events.
  1335.  
  1336. 4.1.  Device Key Events
  1337.  
  1338. DeviceKeyPresss events contain all the information that is
  1339. contained in a core KeyPress event, and also the following
  1340. additional information:
  1341.  
  1342.  
  1343.      -    deviceid - the identifier of the device that gener-
  1344.     ated the event.
  1345.  
  1346.      -    device_state - the state of any modifiers on the
  1347.     device that generated the event
  1348.  
  1349.      -    num_valuators - the number of valuators reported in
  1350.     this event.
  1351.  
  1352.      -    first_valuator - the first valuator reported in this
  1353.     event.
  1354.  
  1355.      -    valuator0 through valuator5 - the values of the val-
  1356.     uators.
  1357.  
  1358. In order to pass this information to the input extension
  1359. library, two 32-byte wire events must be generated by DDX.
  1360. The first has an event type of DeviceKeyPress, and the sec-
  1361. ond has an event type of DeviceValuator.
  1362.  
  1363. The following code fragment shows how the two wire events
  1364. could be initialized:
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.                  18
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. X Input Extension Porting Document        X11, Release 6.4
  1391.  
  1392.  
  1393.      extern int DeviceKeyPress;
  1394.      DeviceIntPtr dev;
  1395.      xEvent xE[2];
  1396.      CARD8 id, num_valuators;
  1397.      INT16 x, y, pointerx, pointery;
  1398.      Time timestamp;
  1399.      deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *) xE;
  1400.      deviceValuator *xv;
  1401.  
  1402.      xev->type = DeviceKeyPress;            /* defined by input extension */
  1403.      xev->detail = keycode;          /* key pressed on this device */
  1404.      xev->time = timestamp;          /* same as for core events    */
  1405.      xev->rootX = pointerx;          /* x location of core pointer */
  1406.      xev->rootY = pointery;          /* y location of core pointer */
  1407.  
  1408.      /******************************************************************/
  1409.      /*                                   */
  1410.      /* The following field does not exist for core input events.       */
  1411.      /* It contains the device id for the device that generated the    */
  1412.      /* event, and also indicates whether more than one 32-byte wire   */
  1413.      /* event is being sent.                       */
  1414.      /*                                   */
  1415.      /******************************************************************/
  1416.  
  1417.      xev->deviceid = dev->id | MORE_EVENTS;        /* sending more than 1*/
  1418.  
  1419.      /******************************************************************/
  1420.      /* Fields in the second 32-byte wire event:               */
  1421.      /******************************************************************/
  1422.  
  1423.      xv = (deviceValuator *) ++xev;
  1424.      xv->type = DeviceValuator;         /* event type of second event */
  1425.      xv->deviceid = dev->id;         /* id of this device       */
  1426.      xv->num_valuators = 0;          /* no valuators being sent    */
  1427.      xv->device_state  = 0;          /* will be filled in by DIX   */
  1428.  
  1429.  
  1430. 4.2.  Device Button Events
  1431.  
  1432. DeviceButton events contain all the information that is con-
  1433. tained in a core button event, and also the same additional
  1434. information that a DeviceKey event contains.
  1435.  
  1436. 4.3.  Device Motion Events
  1437.  
  1438. DeviceMotion events contain all the information that is con-
  1439. tained in a core motion event, and also additional valuator
  1440. information.  At least two wire events are required to con-
  1441. tain this information.    The following code fragment shows
  1442. how the two wire events could be initialized:
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.                  19
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. X Input Extension Porting Document        X11, Release 6.4
  1457.  
  1458.  
  1459.      extern int DeviceMotionNotify;
  1460.      DeviceIntPtr dev;
  1461.      xEvent xE[2];
  1462.      CARD8 id, num_valuators;
  1463.      INT16 x, y, pointerx, pointery;
  1464.      Time timestamp;
  1465.      deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *) xE;
  1466.      deviceValuator *xv;
  1467.  
  1468.      xev->type = DeviceMotionNotify;     /* defined by input extension */
  1469.      xev->detail = keycode;          /* key pressed on this device */
  1470.      xev->time = timestamp;          /* same as for core events    */
  1471.      xev->rootX = pointerx;          /* x location of core pointer */
  1472.      xev->rootY = pointery;          /* y location of core pointer */
  1473.  
  1474.      /******************************************************************/
  1475.      /*                                   */
  1476.      /* The following field does not exist for core input events.       */
  1477.      /* It contains the device id for the device that generated the    */
  1478.      /* event, and also indicates whether more than one 32-byte wire   */
  1479.      /* event is being sent.                       */
  1480.      /*                                   */
  1481.      /******************************************************************/
  1482.  
  1483.      xev->deviceid = dev->id | MORE_EVENTS;        /* sending more than 1*/
  1484.  
  1485.      /******************************************************************/
  1486.      /* Fields in the second 32-byte wire event:               */
  1487.      /******************************************************************/
  1488.  
  1489.      xv = (deviceValuator *) ++xev;
  1490.      xv->type = DeviceValuator;         /* event type of second event */
  1491.      xv->deviceid = dev->id;         /* id of this device       */
  1492.      xv->num_valuators = 2;          /* 2 valuators being sent       */
  1493.      xv->first_valuator = 0;         /* first valuator being sent  */
  1494.      xv->device_state  = 0;          /* will be filled in by DIX   */
  1495.      xv->valuator0 = x;             /* first axis of this device  */
  1496.      xv->valuator1 = y;             /* second axis of this device */
  1497.  
  1498.  
  1499. Up to six axes can be reported in the deviceValuator event.
  1500. If the device is reporting more than 6 axes, additional
  1501. pairs of DeviceMotionNotify and DeviceValuator events should
  1502. be sent,  with the first_valuator field set correctly.
  1503.  
  1504. 4.4.  Device Proximity Events
  1505.  
  1506. Some input devices that report absolute positional informa-
  1507. tion, such as graphics tablets and touchscreens, may report
  1508. proximity events.  ProximityIn events are generated when a
  1509. pointing device like a stylus, or in the case of a touch-
  1510. screen, the user's finger, comes into close proximity with
  1511. the surface of the input device.  ProximityOut events are
  1512. generated when the stylus or finger leaves the proximity of
  1513.  
  1514.  
  1515.  
  1516.                  20
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522. X Input Extension Porting Document        X11, Release 6.4
  1523.  
  1524.  
  1525. the input devices surface.
  1526.  
  1527. Proximity events contain almost the same information as but-
  1528. ton events.  The event type is ProximityIn or ProximityOut,
  1529. and there is no detail information.
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.                  21
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588. X Input Extension Porting Document        X11, Release 6.4
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.                  22
  1649.  
  1650.  
  1651.