⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xgrabpointer.html

📁 linux图形界面x liberary手册
💻 HTML
字号:
<HTML><HEAD><TITLE>Xlib Programming Manual: XGrabPointer</TITLE></HEAD><BODY><H1 ALIGN=center>XGrabPointer</H1><H2>Syntax</H2><!.IN "Grabbing" "pointer"><!.IN "Pointer" "grabbing"><!.IN "XGrabPointer" "" "@DEF@"><CODE><PRE>int XGrabPointer(<B>display</B>, <B>grab_window</B>, <B>owner_events</B>, <B>event_mask</B>, <B>pointer_mode</B>,               <B>keyboard_mode</B>, <B>confine_to</B>, <B>cursor</B>, <B>time</B>)      <A HREF="../display/opening.html#Display">Display</A> *<B>display</B>;      Window <B>grab_window</B>;      Bool <B>owner_events</B>;      unsigned int <B>event_mask</B>;	      int <B>pointer_mode</B>, <B>keyboard_mode</B>;       Window <B>confine_to</B>;       Cursor <B>cursor</B>;       <A HREF="pointer-grabbing.html#Time">Time</A> <B>time</B>; </PRE></CODE><H2>Arguments</H2><TABLE><TR><TD> <B>display</B><TD> Specifies the connection to the X server.<TR><TD> <B>grab_window</B><TD> Specifies the grab window.<TR><TD> <B>owner_events</B><TD> Specifies a Boolean value that indicates whether the pointer events are to be reported as usual or reported with respect to the grab window if selected by the event mask.<TR><TD> <B>event_mask</B><TD> Specifies which pointer events are reported to the client.The mask is the bitwise inclusive OR of the valid pointer event mask bits.<TR><TD> <B>pointer_mode</B><TD> Specifies further processing of pointer events.You can pass <B>GrabModeSync</B>or<B>GrabModeAsync</B>.<TR><TD> <B>keyboard_mode</B><TD> Specifies further processing of keyboard events.You can pass <B>GrabModeSync</B> or<B>GrabModeAsync</B>.<TR><TD> <B>confine_to</B><TD> Specifies the window to confine the pointer in or<B>None</B>.<TR><TD> <B>cursor</B><TD> Specifies the cursor that is to be displayed during the grab or<B>None</B>. <TR><TD> <B>time</B><TD> Specifies the time.You can pass either a timestamp or<B>CurrentTime</B>.</TABLE><H2>Description</H2>The<B>XGrabPointer()</B>function actively grabs control of the pointer and returns<B>GrabSuccess</B>if the grab was successful.Further pointer events are reported only to the grabbing client.<B>XGrabPointer()</B>overrides any active pointer grab by this client.If owner_events is <B>False</B>, all generated pointer eventsare reported with respect to grab_window and are reported only ifselected by event_mask.If owner_events is <B>True</B>and if a generatedpointer event would normally be reported to this client, it is reported as usual. Otherwise, the event is reported with respect to thegrab_window and is reported only if selected by event_mask.For either value of owner_events, unreported events are discarded.<P>If the pointer_mode is <B>GrabModeAsync</B>, pointer event processing continues as usual.If the pointer is currently frozen by this client, the processing of events for the pointer is resumed.If the pointer_mode is <B>GrabModeSync</B>, the state of the pointer, as seen byclient applications,appears to freeze, and the X server generates no further pointer eventsuntil the grabbing client calls <B><A HREF="XAllowEvents.html">XAllowEvents()</A></B>or until the pointer grab is released.Actual pointer changes are not lost while the pointer is frozen;they are simply queued in the server for later processing.<P>If the keyboard_mode is <B>GrabModeAsync</B>, keyboard event processing is unaffected by activation of the grab.If the keyboard_mode is <B>GrabModeSync</B>, the state of the keyboard, as seen byclient applications,appears to freeze, and the X server generates no further keyboard eventsuntil the grabbing client calls <B><A HREF="XAllowEvents.html">XAllowEvents()</A></B>or until the pointer grab is released.Actual keyboard changes are not lost while the pointer is frozen;they are simply queued in the server for later processing.<P>If a cursor is specified, it is displayed regardless of whatwindow the pointer is in.  If <B>None</B>is specified,the normal cursor for that window is displayedwhen the pointer is in grab_window or one of its subwindows;otherwise, the cursor for grab_window is displayed.<P>If a confine_to window is specified,the pointer is restricted to stay contained in that window.The confine_to window need have no relationship to the grab_window.If the pointer is not initially in the confine_to window, it is warped automatically to the closest edge just before the grab activates and enter/leave events are generated as usual. If the confine_to window is subsequently reconfigured, the pointer is warped automatically, as necessary, to keep it contained in the window.<P>The time argument allows you to avoid certain circumstances that come upif applications take a long time to respond or if there are long networkdelays.Consider a situation where you have two applications, bothof which normally grab the pointer when clicked on.If both applications specify the timestamp from the event, the second application may wake up faster and successfully grab the pointerbefore the first application. The first application then will get an indication that the other application grabbed the pointer before its request was processed.<P><B>XGrabPointer()</B>generates<B><A HREF="../events/window-entry-exit/">EnterNotify</A></B> and<B><A HREF="../events/window-entry-exit/">LeaveNotify</A></B> events.<P>Either if grab_window or confine_to window is not viewableor if the confine_to window lies completely outside the boundaries of the rootwindow,<B>XGrabPointer()</B>fails and returns<B>GrabNotViewable</B>.If the pointer is actively grabbed by some other client,it fails and returns<B>AlreadyGrabbed</B>.If the pointer is frozen by an active grab of another client,it fails and returns<B>GrabFrozen</B>.If the specified time is earlier than the last-pointer-grab time or later than the current X server time, it fails and returns<B>GrabInvalidTime</B>.Otherwise, the last-pointer-grab time is set to the specified time(<B>CurrentTime</B> is replaced by the current X server time).<P><B>XGrabPointer()</B>can generate<B>BadCursor</B>,<B>BadValue</B>,and<B>BadWindow</B> errors.<H2>Diagnostics</H2><TABLE><TR><TD><B>BadCursor</B> <TD>A value for a Cursor argument does not name a    defined Cursor.<TR><TD><B>BadValue</B><TD> Some numeric value falls outside the range of values accepted by the request.     Unless a specific range is specified for an argument, the full range defined     by the argument's type is accepted.  Any argument defined as a set of     alternatives can generate this error.<TR><TD><B>BadWindow</B><TD>A value for a Window argument does not name a defined Window.</TABLE><H2>See also</H2><B><A HREF="XAllowEvents.html">XAllowEvents()</A></B>,<B><A HREF="XChangeActivePointerGrab.html">XChangeActivePointerGrab()</A></B>,<B><A HREF="XGrabButton.html">XGrabButton()</A></B>,<B><A HREF="XGrabKey.html">XGrabKey()</A></B>,<B><A HREF="XGrabKeyboard.html">XGrabKeyboard()</A></B>,<B><A HREF="XUngrabPointer.html">XUngrabPointer()</A></B>,"<A HREF="pointer-grabbing.html">Pointer Grabbing</A>".<HR><ADDRESS><A HREF="http://tronche.com/">Christophe Tronche</A>, <A HREF="mailto:ch.tronche@computer.org">ch.tronche@computer.org</A></ADDRESS></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -