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

  1.  
  2.  
  3.  
  4. XGrabPointer(3X11)      XLIB FUNCTIONS       XGrabPointer(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XGrabPointer, XUngrabPointer, XChangeActivePointerGrab -
  9.        grab the pointer
  10.  
  11. SSYYNNTTAAXX
  12.        int XGrabPointer(_d_i_s_p_l_a_y, _g_r_a_b___w_i_n_d_o_w, _o_w_n_e_r___e_v_e_n_t_s,
  13.        _e_v_e_n_t___m_a_s_k, _p_o_i_n_t_e_r___m_o_d_e,
  14.               _k_e_y_b_o_a_r_d___m_o_d_e, _c_o_n_f_i_n_e___t_o, _c_u_r_s_o_r, _t_i_m_e)
  15.          Display *_d_i_s_p_l_a_y;
  16.          Window _g_r_a_b___w_i_n_d_o_w;
  17.          Bool _o_w_n_e_r___e_v_e_n_t_s;
  18.          unsigned int _e_v_e_n_t___m_a_s_k;
  19.          int _p_o_i_n_t_e_r___m_o_d_e, _k_e_y_b_o_a_r_d___m_o_d_e;
  20.          Window _c_o_n_f_i_n_e___t_o;
  21.          Cursor _c_u_r_s_o_r;
  22.          Time _t_i_m_e;
  23.  
  24.        XUngrabPointer(_d_i_s_p_l_a_y, _t_i_m_e)
  25.          Display *_d_i_s_p_l_a_y;
  26.          Time _t_i_m_e;
  27.  
  28.        XChangeActivePointerGrab(_d_i_s_p_l_a_y, _e_v_e_n_t___m_a_s_k, _c_u_r_s_o_r,
  29.        _t_i_m_e)
  30.          Display *_d_i_s_p_l_a_y;
  31.          unsigned int _e_v_e_n_t___m_a_s_k;
  32.          Cursor _c_u_r_s_o_r;
  33.          Time _t_i_m_e;
  34.  
  35. AARRGGUUMMEENNTTSS
  36.        _c_o_n_f_i_n_e___t_o
  37.          Specifies the window to confine the pointer in
  38.          or _N_o_n_e.
  39.  
  40.        _c_u_r_s_o_r     Specifies the cursor that is to be displayed
  41.          during the grab or _N_o_n_e.
  42.  
  43.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  44.  
  45.        _e_v_e_n_t___m_a_s_k
  46.          Specifies which pointer events are reported to
  47.          the client.  The mask is the bitwise inclusive
  48.          OR of the valid pointer event mask bits.
  49.  
  50.        _g_r_a_b___w_i_n_d_o_w
  51.          Specifies the grab window.
  52.  
  53.        _k_e_y_b_o_a_r_d___m_o_d_e
  54.          Specifies further processing of keyboard events.
  55.          You can pass _G_r_a_b_M_o_d_e_S_y_n_c or _G_r_a_b_M_o_d_e_A_s_y_n_c.
  56.  
  57.        _o_w_n_e_r___e_v_e_n_t_s
  58.          Specifies a Boolean value that indicates whether
  59.          the pointer events are to be reported as usual
  60.          or reported with respect to the grab window if
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XGrabPointer(3X11)      XLIB FUNCTIONS       XGrabPointer(3X11)
  71.  
  72.  
  73.          selected by the event mask.
  74.  
  75.        _p_o_i_n_t_e_r___m_o_d_e
  76.          Specifies further processing of pointer events.
  77.          You can pass _G_r_a_b_M_o_d_e_S_y_n_c or _G_r_a_b_M_o_d_e_A_s_y_n_c.
  78.  
  79.        _t_i_m_e     Specifies the time.  You can pass either a
  80.          timestamp or _C_u_r_r_e_n_t_T_i_m_e.
  81.  
  82. DDEESSCCRRIIPPTTIIOONN
  83.        The _X_G_r_a_b_P_o_i_n_t_e_r function actively grabs control of the
  84.        pointer and returns _G_r_a_b_S_u_c_c_e_s_s if the grab was success-
  85.        ful.  Further pointer events are reported only to the
  86.        grabbing client.     _X_G_r_a_b_P_o_i_n_t_e_r overrides any active
  87.        pointer grab by this client.  If owner_events is _F_a_l_s_e,
  88.        all generated pointer events are reported with respect to
  89.        grab_window and are reported only if selected by
  90.        event_mask.  If owner_events is _T_r_u_e and if a generated
  91.        pointer event would normally be reported to this client,
  92.        it is reported as usual.     Otherwise, the event is reported
  93.        with respect to the grab_window and is reported only if
  94.        selected by event_mask.    For either value of owner_events,
  95.        unreported events are discarded.
  96.  
  97.        If the pointer_mode is _G_r_a_b_M_o_d_e_A_s_y_n_c, pointer event pro-
  98.        cessing continues as usual.  If the pointer is currently
  99.        frozen by this client, the processing of events for the
  100.        pointer is resumed.  If the pointer_mode is _G_r_a_b_M_o_d_e_S_y_n_c,
  101.        the state of the pointer, as seen by client applications,
  102.        appears to freeze, and the X server generates no further
  103.        pointer events until the grabbing client calls _X_A_l_l_o_w_-
  104.        _E_v_e_n_t_s or until the pointer grab is released.  Actual
  105.        pointer changes are not lost while the pointer is frozen;
  106.        they are simply queued in the server for later processing.
  107.  
  108.        If the keyboard_mode is _G_r_a_b_M_o_d_e_A_s_y_n_c, keyboard event pro-
  109.        cessing is unaffected by activation of the grab.     If the
  110.        keyboard_mode is _G_r_a_b_M_o_d_e_S_y_n_c, the state of the keyboard,
  111.        as seen by client applications, appears to freeze, and the
  112.        X server generates no further keyboard events until the
  113.        grabbing client calls _X_A_l_l_o_w_E_v_e_n_t_s or until the pointer
  114.        grab is released.  Actual keyboard changes are not lost
  115.        while the pointer is frozen; they are simply queued in the
  116.        server for later processing.
  117.  
  118.        If a cursor is specified, it is displayed regardless of
  119.        what window the pointer is in.  If _N_o_n_e is specified, the
  120.        normal cursor for that window is displayed when the
  121.        pointer is in grab_window or one of its subwindows; other-
  122.        wise, the cursor for grab_window is displayed.
  123.  
  124.        If a confine_to window is specified, the pointer is
  125.        restricted to stay contained in that window.  The con-
  126.        fine_to window need have no relationship to the
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XGrabPointer(3X11)      XLIB FUNCTIONS       XGrabPointer(3X11)
  137.  
  138.  
  139.        grab_window.  If the pointer is not initially in the con-
  140.        fine_to window, it is warped automatically to the closest
  141.        edge just before the grab activates and enter/leave events
  142.        are generated as usual.    If the confine_to window is sub-
  143.        sequently reconfigured, the pointer is warped automati-
  144.        cally, as necessary, to keep it contained in the window.
  145.  
  146.        The time argument allows you to avoid certain circum-
  147.        stances that come up if applications take a long time to
  148.        respond or if there are long network delays.  Consider a
  149.        situation where you have two applications, both of which
  150.        normally grab the pointer when clicked on.  If both appli-
  151.        cations specify the timestamp from the event, the second
  152.        application may wake up faster and successfully grab the
  153.        pointer before the first application.  The first applica-
  154.        tion then will get an indication that the other applica-
  155.        tion grabbed the pointer before its request was processed.
  156.  
  157.        _X_G_r_a_b_P_o_i_n_t_e_r generates _E_n_t_e_r_N_o_t_i_f_y and _L_e_a_v_e_N_o_t_i_f_y events.
  158.  
  159.        Either if grab_window or confine_to window is not viewable
  160.        or if the confine_to window lies completely outside the
  161.        boundaries of the root window, _X_G_r_a_b_P_o_i_n_t_e_r fails and
  162.        returns _G_r_a_b_N_o_t_V_i_e_w_a_b_l_e.     If the pointer is actively
  163.        grabbed by some other client, it fails and returns
  164.        _A_l_r_e_a_d_y_G_r_a_b_b_e_d.    If the pointer is frozen by an active
  165.        grab of another client, it fails and returns _G_r_a_b_F_r_o_z_e_n.
  166.        If the specified time is earlier than the last-pointer-
  167.        grab time or later than the current X server time, it
  168.        fails and returns _G_r_a_b_I_n_v_a_l_i_d_T_i_m_e.  Otherwise, the last-
  169.        pointer-grab time is set to the specified time (_C_u_r_r_e_n_t_-
  170.        _T_i_m_e is replaced by the current X server time).
  171.  
  172.        _X_G_r_a_b_P_o_i_n_t_e_r can generate _B_a_d_C_u_r_s_o_r, _B_a_d_V_a_l_u_e, and _B_a_d_W_i_n_-
  173.        _d_o_w errors.
  174.  
  175.        The _X_U_n_g_r_a_b_P_o_i_n_t_e_r function releases the pointer and any
  176.        queued events if this client has actively grabbed the
  177.        pointer from _X_G_r_a_b_P_o_i_n_t_e_r, _X_G_r_a_b_B_u_t_t_o_n, or from a normal
  178.        button press.  _X_U_n_g_r_a_b_P_o_i_n_t_e_r does not release the pointer
  179.        if the specified time is earlier than the last-pointer-
  180.        grab time or is later than the current X server time.  It
  181.        also generates _E_n_t_e_r_N_o_t_i_f_y and _L_e_a_v_e_N_o_t_i_f_y events.  The X
  182.        server performs an _U_n_g_r_a_b_P_o_i_n_t_e_r request automatically if
  183.        the event window or confine_to window for an active
  184.        pointer grab becomes not viewable or if window reconfigu-
  185.        ration causes the confine_to window to lie completely out-
  186.        side the boundaries of the root window.
  187.  
  188.        The _X_C_h_a_n_g_e_A_c_t_i_v_e_P_o_i_n_t_e_r_G_r_a_b function changes the speci-
  189.        fied dynamic parameters if the pointer is actively grabbed
  190.        by the client and if the specified time is no earlier than
  191.        the last-pointer-grab time and no later than the current X
  192.        server time.  This function has no effect on the passive
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. XGrabPointer(3X11)      XLIB FUNCTIONS       XGrabPointer(3X11)
  203.  
  204.  
  205.        parameters of a _X_G_r_a_b_B_u_t_t_o_n.  The interpretation of
  206.        event_mask and cursor is the same as described in
  207.        _X_G_r_a_b_P_o_i_n_t_e_r.
  208.  
  209.        _X_C_h_a_n_g_e_A_c_t_i_v_e_P_o_i_n_t_e_r_G_r_a_b can generate a _B_a_d_C_u_r_s_o_r and _B_a_d_-
  210.        _V_a_l_u_e error.
  211.  
  212. DDIIAAGGNNOOSSTTIICCSS
  213.        _B_a_d_C_u_r_s_o_r A value for a Cursor argument does not name a
  214.          defined Cursor.
  215.  
  216.        _B_a_d_V_a_l_u_e     Some numeric value falls outside the range of
  217.          values accepted by the request.  Unless a spe-
  218.          cific range is specified for an argument, the
  219.          full range defined by the argument's type is
  220.          accepted.  Any argument defined as a set of
  221.          alternatives can generate this error.
  222.  
  223.        _B_a_d_W_i_n_d_o_w A value for a Window argument does not name a
  224.          defined Window.
  225.  
  226. SSEEEE AALLSSOO
  227.        XAllowEvents(3X11), XGrabButton(3X11), XGrabKey(3X11),
  228.        XGrabKeyboard(3X11)
  229.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  230.  
  231.  
  232.  
  233.  
  234.  
  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.