home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xlistinputdevices.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  7.9 KB  |  265 lines

  1.  
  2.  
  3.  
  4. XListInputDevices(3X11)       X FUNCTIONS      XListInputDevices(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XListInputDevices,  XFreeDeviceList - list available input
  9.        devices
  10.  
  11. SSYYNNTTAAXX
  12.        XDeviceInfo *XListInputDevices(_d_i_s_p_l_a_y, _n_d_e_v_i_c_e_s___r_e_t_u_r_n)
  13.          Display *_d_i_s_p_l_a_y;
  14.          int *_n_d_e_v_i_c_e_s___r_e_t_u_r_n;
  15.  
  16.        XFreeDeviceList(_l_i_s_t)
  17.          XDeviceInfo *_l_i_s_t;
  18.  
  19. AARRGGUUMMEENNTTSS
  20.        _d_i_s_p_l_a_y       Specifies the connection to the X server.
  21.  
  22.        _n_d_e_v_i_c_e_s___r_e_t_u_r_n
  23.            Specifies a pointer to a  variable  where  the
  24.            number of available devices can be returned.
  25.  
  26.        _l_i_s_t       Specifies  the  list     of devices to free.  The
  27.            _X_F_r_e_e_D_e_v_i_c_e_L_i_s_t function  frees  the     list  of
  28.            available extension input devices.
  29.  
  30. DDEESSCCRRIIPPTTIIOONN
  31.        The  _X_L_i_s_t_I_n_p_u_t_D_e_v_i_c_e_s  request lists the available exten-
  32.        sion input devices.  This list includes the X pointer  and
  33.        X  keyboard,  any  other     input devices that are currently
  34.        accessible through the X server,     and  any  input  devices
  35.        that are not currently accessible through the X server but
  36.        could be accessed if requested.
  37.  
  38.        Some server implementations may    make  all  input  devices
  39.        available  at  the time the server is initialized.  Others
  40.        may wait until requested by a client to    access    an  input
  41.        device.     In the latter case, it is possible that an input
  42.        device will be listed as available at one time but not  at
  43.        another.
  44.  
  45.        For  each  input     device     available  to    the  server,  the
  46.        XListInputDevices request returns  an  XDeviceInfo  struc-
  47.        ture.   That  structure    contains  a  pointer to a list of
  48.        structures, each of which contains information  about  one
  49.        class of input supported by the device.
  50.  
  51.        The XDeviceInfo structure is defined as follows:
  52.  
  53.        typedef struct _XDeviceInfo
  54.        {
  55.         XID          id;
  56.         Atom      type;
  57.         char      *name;
  58.         int          num_classes;
  59.         int          use;
  60.         XAnyClassPtr   inputclassinfo;
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XListInputDevices(3X11)       X FUNCTIONS      XListInputDevices(3X11)
  71.  
  72.  
  73.        } XDeviceInfo;
  74.  
  75.        The  id is a number in the range 0-128 that uniquely iden-
  76.        tifies the device.  It is assigned to the device     when  it
  77.        is initialized by the server.
  78.  
  79.        The type field is of type Atom and indicates the nature of
  80.        the device.
  81.  
  82.        The name field contains a  pointer  to  a  null-terminated
  83.        string  that  corresponds  to  one  of  the defined device
  84.        types.  The name will correspond to one of  the    following
  85.        strings (defined in the header file _X_I_._h:
  86.  
  87.        XI_MOUSE     XI_TABLET XI_KEYBOARD XI_TOUCHSCREEN XI_TOUCHPAD
  88.        XI_BUTTONBOX   XI_BARCODE    XI_TRACKBALL    XI_QUADRATURE
  89.        XI_ID_MODULE    XI_ONE_KNOB    XI_NINE_KNOB    XI_KNOB_BOX
  90.        XI_SPACEBALL  XI_DATAGLOVE   XI_EYETRACKER   XI_CURSORKEYS
  91.        XI_FOOTMOUSE
  92.  
  93.        These  names  may be directly compared with the name field
  94.        of the XDeviceInfo structure, or used  in  an  XInternAtom
  95.        request    to  return  an atom that can be compared with the
  96.        type field of the XDeviceInfo structure.
  97.  
  98.        The num_classes field is a number in the range 0-255  that
  99.        specifies  the  number  of  input classes supported by the
  100.        device for which information is returned     by  ListInputDe-
  101.        vices.    Some input classes, such as class Focus and class
  102.        Proximity do not have any information to     be  returned  by
  103.        ListInputDevices.
  104.  
  105.        The  use field specifies how the device is currently being
  106.        used.  If the value is _I_s_X_K_e_y_b_o_a_r_d,  the     device     is  cur-
  107.        rently being used as the X keyboard.  If the value is _I_s_X_-
  108.        _P_o_i_n_t_e_r, the device is  currently  being     used  as  the    X
  109.        pointer.      If  the value is _I_s_X_E_x_t_e_n_s_i_o_n_D_e_v_i_c_e, the device
  110.        is available for use as an extension device.
  111.  
  112.        The inputclassinfo field contains a pointer to  the  first
  113.        input-class  specific data.  The first two fields are com-
  114.        mon to all classes.
  115.  
  116.        The class field is  a  number  in  the  range  0-255.   It
  117.        uniquely     identifies the class of input for which informa-
  118.        tion is returned.  Currently defined classes are KeyClass,
  119.        ButtonClass, and ValuatorClass.
  120.  
  121.        The  length  field  is  a  number in the range 0- 255.  It
  122.        specifies the number of bytes of data that  are    contained
  123.        in  this     input    class.    The length includes the class and
  124.        length fields.
  125.  
  126.        The XKeyInfo structure describes     the  characteristics  of
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XListInputDevices(3X11)       X FUNCTIONS      XListInputDevices(3X11)
  137.  
  138.  
  139.        the keys on the device.    It is defined as follows:
  140.  
  141.        typedef struct _XKeyInfo {
  142.         XID           class;
  143.         int           length;
  144.         unsigned short    min_keycode;
  145.         unsigned short    max_keycode;
  146.         unsigned short    num_keys;
  147.        } XKeyInfo;
  148.  
  149.        min_keycode  is of type KEYCODE.     It specifies the minimum
  150.        keycode that the device will report.  The minimum  keycode
  151.        will not be smaller than 8.
  152.  
  153.        max_keycode  is of type KEYCODE.     It specifies the maximum
  154.        keycode that the device will report.  The maximum  keycode
  155.        will not be larger than 255.
  156.  
  157.        num_keys specifies the number of keys that the device has.
  158.  
  159.        The XButtonInfo structure defines the  characteristics  of
  160.        the buttons on the device.  It is defined as follows:
  161.  
  162.        typedef struct _XButtonInfo {
  163.         XID          class;
  164.         int          length;
  165.         short       num_buttons;
  166.        } XButtonInfo;
  167.  
  168.        num_buttons  specifies  the  number  of    buttons     that the
  169.        device has.
  170.  
  171.        The XValuatorInfo structure defines the characteristics of
  172.        the valuators on the device.  It is defined as follows:
  173.  
  174.        typedef struct _XValuatorInfo {
  175.         XID           class;
  176.         int           length;
  177.         unsigned char    num_axes;
  178.         unsigned char    mode;
  179.         unsigned long    motion_buffer;
  180.         XAxisInfoPtr    axes;
  181.        } XValuatorInfo;
  182.        num_axes     contains the number of axes the device supports.
  183.  
  184.        mode is a constant that has one of the  following  values:
  185.        Absolute     or  Relative.    Some devices allow the mode to be
  186.        changed dynamically via the SetDeviceMode request.
  187.  
  188.        motion_buffer_size is a cardinal number that specifies the
  189.        number  of  elements  that  can be contained in the motion
  190.        history buffer for the device.
  191.  
  192.        The  axes  field     contains  a  pointer  to  an    XAxisInfo
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. XListInputDevices(3X11)       X FUNCTIONS      XListInputDevices(3X11)
  203.  
  204.  
  205.        structure.
  206.  
  207.        The XAxisInfo structure is defined as follows:
  208.  
  209.        typedef struct _XAxisInfo {
  210.         int     resolution;
  211.         int     min_value;
  212.         int     max_value;
  213.        } XAxisInfo;
  214.  
  215.        The resolution contains a number in counts/meter.
  216.  
  217.        The  min_val  field  contains  a number that specifies the
  218.        minimum value the  device  reports  for    this  axis.   For
  219.        devices    whose  mode  is     Relative, the min_val field will
  220.        contain 0.
  221.  
  222.        The max_val field contains a  number  that  specifies  the
  223.        maximum    value  the  device  reports  for  this axis.  For
  224.        devices whose mode is Relative,    the  max_val  field  will
  225.        contain 0.
  226.  
  227.        To  free     the  _X_D_e_v_i_c_e_I_n_f_o  array created by _X_L_i_s_t_I_n_p_u_t_D_e_-
  228.        _v_i_c_e_s, use _X_F_r_e_e_D_e_v_i_c_e_L_i_s_t.
  229.  
  230. DDIIAAGGNNOOSSTTIICCSS
  231.        none.
  232.  
  233. SSEEEE AALLSSOO
  234.        _P_r_o_g_r_a_m_m_i_n_g _w_i_t_h _X_l_i_b
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.