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

  1.  
  2.  
  3.  
  4. XOpenDevice(3X11)       X FUNCTIONS        XOpenDevice(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XOpenDevice,  XCloseDevice  -  open  or close an extension
  9.        input device
  10.  
  11. SSYYNNTTAAXX
  12.        XXDDeevviiccee **XXOOppeennDDeevviiccee((_d_i_s_p_l_a_y,, _d_e_v_i_c_e___i_d))
  13.          DDiissppllaayy **_d_i_s_p_l_a_y;;
  14.          XXIIDD _d_e_v_i_c_e___i_d;;
  15.  
  16.        XXCClloosseeDDeevviiccee((_d_i_s_p_l_a_y,, _d_e_v_i_c_e))
  17.          DDiissppllaayy **_d_i_s_p_l_a_y;;
  18.          XXDDeevviiccee **_d_e_v_i_c_e;;
  19.  
  20.  
  21. AARRGGUUMMEENNTTSS
  22.        _d_i_s_p_l_a_y       Specifies the connection to the X server.
  23.  
  24.        _d_e_v_i_c_e___i_d   Specifies the id of the device to be opened
  25.  
  26.        _d_e_v_i_c_e       Specifies the device to be closed
  27.  
  28. DDEESSCCRRIIPPTTIIOONN
  29.        The _X_O_p_e_n_D_e_v_i_c_e request makes an input  device  accessible
  30.        to a client through input extension protocol requests.  If
  31.        successful, it returns a pointer to an XXDDeevviiccee  structure.
  32.  
  33.        The  _X_C_l_o_s_e_D_e_v_i_c_e request makes an input device inaccessi-
  34.        ble to a client through input extension protocol requests.
  35.        Before  terminating,  and  client  that    has  opened input
  36.        devices through the input extension should close them  via
  37.        _C_l_o_s_e_D_e_v_i_c_e.
  38.  
  39.        When  a    client    makes an _X_C_l_o_s_e_D_e_v_i_c_e request, any active
  40.        grabs that the client has on the device are released.  Any
  41.        event  selections that the client has are deleted, as well
  42.        as any passive grabs.  If the  requesting  client  is  the
  43.        last  client  accessing the device, the server may disable
  44.        all access by X to the device.
  45.  
  46.        _X_O_p_e_n_D_e_v_i_c_e and    _X_C_l_o_s_e_D_e_v_i_c_e  can  generate  a    _B_a_d_D_e_v_i_c_e
  47.        error.
  48.  
  49. SSTTRRUUCCTTUURREESS
  50.        The _X_D_e_v_i_c_e structure returned by _X_O_p_e_n_D_e_v_i_c_e contains:
  51.        typedef struct {
  52.         XID device_id;
  53.         int num_classes;
  54.         XInputClassInfo *classes;
  55.        } XDevice;
  56.  
  57.        The classes field is a pointer to an array of XInputClass-
  58.        Info structures.     Each element of this array  contains  an
  59.        event  type  base  for  a  class of input supported by the
  60.        specified device.  The  num_classes  field  indicates  the
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XOpenDevice(3X11)       X FUNCTIONS        XOpenDevice(3X11)
  71.  
  72.  
  73.        number of elements in the classes array.
  74.  
  75.        The _X_I_n_p_u_t_C_l_a_s_s_I_n_f_o structure contains:
  76.  
  77.        typedef struct {
  78.         unsigned char input_class;
  79.         unsigned char event_type_base;
  80.        } XInputClassInfo;
  81.  
  82.        The  input_class     field identifies one class of input sup-
  83.        ported by the device.   Defined    types  include    _K_e_y_C_l_a_s_s,
  84.        _B_u_t_t_o_n_C_l_a_s_s, _V_a_l_u_a_t_o_r_C_l_a_s_s, _P_r_o_x_i_m_i_t_y_C_l_a_s_s, _F_e_e_d_b_a_c_k_C_l_a_s_s,
  85.        _F_o_c_u_s_C_l_a_s_s, and _O_t_h_e_r_C_l_a_s_s.  The     event_type_base  identi-
  86.        fies the event type of the first event in that class.
  87.  
  88.        The information contained in the _X_I_n_p_u_t_C_l_a_s_s_I_n_f_o structure
  89.        is used by macros to obtain the event classes that clients
  90.        use  in    making _X_S_e_l_e_c_t_E_x_t_e_n_s_i_o_n_E_v_e_n_t requests.    Currently
  91.        defined macros include  _D_e_v_i_c_e_K_e_y_P_r_e_s_s,    _D_e_v_i_c_e_K_e_y_R_e_l_e_a_s_e,
  92.        _D_e_v_i_c_e_B_u_t_t_o_n_P_r_e_s_s, _D_e_v_i_c_e_B_u_t_t_o_n_R_e_l_e_s_e, _D_e_v_i_c_e_M_o_t_i_o_n_N_o_t_i_f_y,
  93.        _D_e_v_i_c_e_F_o_c_u_s_I_n, _D_e_v_i_c_e_F_o_c_u_s_O_u_t, _P_r_o_x_i_m_i_t_y_I_n,  _P_r_o_x_i_m_i_t_y_O_u_t,
  94.        _D_e_v_i_c_e_S_t_a_t_e_N_o_t_i_f_y,  _D_e_v_i_c_e_M_a_p_p_i_i_n_g_N_o_t_i_f_y,  _C_h_a_n_g_e_D_e_v_i_c_e_N_o_-
  95.        _t_i_f_y,    _D_e_v_i_c_e_P_o_i_n_t_e_r_M_o_t_i_o_n_H_i_n_t,     _D_e_v_i_c_e_B_u_t_t_o_n_1_M_o_t_i_o_n,
  96.        _D_e_v_i_c_e_B_u_t_t_o_n_2_M_o_t_i_o_n,    _D_e_v_i_c_e_B_u_t_t_o_n_3_M_o_t_i_o_n,    _D_e_v_i_c_e_B_u_t_-
  97.        _t_o_n_4_M_o_t_i_o_n,    _D_e_v_i_c_e_B_u_t_t_o_n_5_M_o_t_i_o_n,    _D_e_v_i_c_e_B_u_t_t_o_n_M_o_t_i_o_n,
  98.        _D_e_v_i_c_e_O_w_n_e_r_G_r_a_b_B_u_t_t_o_n, _D_e_v_i_c_e_B_u_t_t_o_n_P_r_e_s_s_G_r_a_b, and _N_o_E_x_t_e_n_-
  99.        _s_i_o_n_E_v_e_n_t.
  100.  
  101.        To obtain the proper event class for a particular  device,
  102.        one  of    the  above  macros  is    invoked using the _X_D_e_v_i_c_e
  103.        structure for that device.  For example,
  104.  
  105.        DeviceKeyPress (*device, type, eventclass);
  106.  
  107.        returns the _D_e_v_i_c_e_K_e_y_P_r_e_s_s event type and  the  eventclass
  108.        for _D_e_v_i_c_e_K_e_y_P_r_e_s_s events from the specified device.
  109.  
  110.        This  _e_v_e_n_t_c_l_a_s_s     can then be used in an _X_S_e_l_e_c_t_E_x_t_e_n_s_i_o_n_-
  111.        _E_v_e_n_t request to ask the     server     to  send  _D_e_v_i_c_e_K_e_y_P_r_e_s_s
  112.        events  from  this  device.   When  a  selected    event  is
  113.        received via _X_N_e_x_t_E_v_e_n_t, the _t_y_p_e can be used for compari-
  114.        son with the type in the event.
  115.  
  116. DDIIAAGGNNOOSSTTIICCSS
  117.        _B_a_d_D_e_v_i_c_e   An  invalid    device was specified.  The speci-
  118.            fied device does not exist, or is the  X  key-
  119.            board or X pointer.    This error may also occur
  120.            if some other client has caused the    specified
  121.            device  to  become the X keyboard or X pointer
  122.            device  via     the   _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_D_e_v_i_c_e   or
  123.            _X_C_h_a_n_g_e_P_o_i_n_t_e_r_D_e_v_i_c_e requests.
  124.  
  125. SSEEEE AALLSSOO
  126.        _P_r_o_g_r_a_m_m_i_n_g _w_i_t_h _X_l_i_b
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.