12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFTThe X server searches the ancestors of w from the root down, looking for a passive grab to activate.If no matching passive grab on the button exists, the X server automatically starts an activegrab for the client receiving the event and sets the last-pointer-grab time to the current servertime. The effect is essentially equivalent to an XGrabButton with these client passed arguments:Argumentwevent_maskpointer_modekeyboard_modeowner_eventsconfine_tocursorValueThe event windowThe client’s selected pointer events on the event windowGrabModeAsyncGrabModeAsyncTrue, ifthe client has selected OwnerGrabButton-Mask on the event window, otherwise FalseNoneNoneThe active grab is automatically terminated when the logical state of the pointer has all buttonsreleased. Clients can modify the active grab by calling XUngrabPointer and XChangeActivePointerGrab.10.5.2. Keyboard and Pointer EventsThis section discusses the processing that occurs for the keyboard events KeyPress and KeyReleaseand the pointer events ButtonPress, ButtonRelease, and MotionNotify. For informationabout the keyboard event-handling utilities, see chapter 11.The X server reports KeyPress or KeyRelease events to clients wanting information about keysthat logically change state. Note that these events are generated for all keys, even those mappedto modifier bits. The X server reports ButtonPress or ButtonRelease events to clients wantinginformation about buttons that logically change state.The X server reports MotionNotify events to clients wanting information about when the pointerlogically moves. The Xserver generates this event whenever the pointer is moved and the pointermotion begins and ends in the window. The granularity of MotionNotify events is not guaranteed,but a client that selects this event type is guaranteed to receive at least one event when thepointer moves and then rests.The generation of the logical changes lags the physical changes if device event processing isfrozen.To receive KeyPress, KeyRelease, ButtonPress, and ButtonRelease events, set KeyPress-Mask, KeyReleaseMask, ButtonPressMask, and ButtonReleaseMask bits in the event-maskattribute of the window.To receive MotionNotify events, set one or more of the following event masks bits in the eventmaskattribute of the window.• Button1MotionMask − Button5MotionMaskThe client application receives MotionNotify events only when one or more of the specifiedbuttons is pressed.• ButtonMotionMaskThe client application receives MotionNotify events only when at least one button ispressed.203

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!