The keyboard and pointer events are: :key-press, :key-release, :button-press, :button-release, :motion-notify, :enter-notify, and :leave-notify.
:key-press, :key-release, :button-press, :button-release | Event Type |
:key-press, and :key-release events are generated when a key or pointer button changes state. Note that :key-press and :key-release are generated for all keys, even those mapped to modifiers. All of these event types have the same slots. The window containing the pointer at the time of the event is referred to as the source window. The event window is the window to which the event is actually reported. The event window is found by starting with the source window and looking up the hierarchy for the first window on which any client has selected interest in the event (provided no intervening window prohibits event generation by including the event type in its do-not-propagate-mask). The actual window used for reporting can be modified by active grabs and, in the case of keyboard events, can be modified by the focus window. A :button-press event has the effect of a temporary grab-button. When a pointer button is pressed and no active pointer grab is in progress, the ancestors of the source window are searched from the root down, looking for a passive grab to activate. If no matching passive grab on the button exists, then an active grab is started automatically for the client receiving the :button-press event, and the last-pointer-grab time is set to the current server time. The effect is essentially equivalent to calling grab-button with the following arguments:
The :button-press grab is terminated automatically when all buttons are released. The functions ungrab-pointer and change-active-pointer-grab can both be used to modify the :button-press grab.
|
:motion-notify | Event Type |
The :motion-notify event is generated when the pointer moves. A :motion-notify event has the same slots as :button-press, :button-release, :key-press, and :key-release events, with the exception that the code slot is replaced by the hint-p slot. As with these other events, the event window for :motion-notify is found by starting with the source window and looking up the hierarchy for the first window on which any client has selected interest in the event (provided no intervening window prohibits event generation by including :motion-notify in its do-not-propagate-mask).The actual window used for reporting can be modified by active grabs. :motion-notify events are generated only when the motion begins and ends in the window. The granularity of motion events is not guaranteed, but a client selecting for motion events is guaranteed to get at least one event when the pointer moves and comes to rest. Selecting :pointer-motion generates :motion-notify events regardless of the state of the pointer buttons. By selecting some subset of :button[1-5]-motion instead, :motion-notify events are only received when one or more of the specified buttons are pressed. By selecting :button-motion, :motion-notify events are only received when at least one button is pressed. If :pointer-motion-hint is also selected, the server is free to send only one :motion-notify, until either the key or button state changes, the pointer leaves the event window, or the client calls query-pointer or motion-events.
|
:enter-notify, :leave-notify | Event Type |
If pointer motion or a window hierarchy change causes the pointer to be in a different window than before, :enter-notify and :leave-notify events are generated instead of a :motion-notify event. All :enter-notify and :leave-notify events caused by a hierarchy change are generated after any hierarchy event (:unmap-notify, :map-notify, :configure-notify, :gravity-notify, or :circulate-notify) caused by that change, but the ordering of :enter-notify and :leave-notify events with respect to :focus-out, :visibility-notify, and :exposure events is not constrained by the X protocol. An :enter-notify or :leave-notify event can also be generated when a client application calls change-active-pointer-grab, grab-pointer, or ungrab-pointer.
|