GdkEventMask

A set of bit-flags to indicate which events a window is to receive. Most of these masks map onto one or more of the #GdkEventType event types above.

See the [input handling overview][chap-input-handling] for details of [event masks][event-masks] and [event propagation][event-propagation].

gdk.types.EventMask.PointerMotionHintMask is deprecated. It is a special mask to reduce the number of gdk.types.EventType.MotionNotify events received. When using gdk.types.EventMask.PointerMotionHintMask, fewer gdk.types.EventType.MotionNotify events will be sent, some of which are marked as a hint (the is_hint member is true). To receive more motion events after a motion hint event, the application needs to asks for more, by calling gdk.event.Event.requestMotions.

Since GTK 3.8, motion events are already compressed by default, independent of this mechanism. This compression can be disabled with gdk.window.Window.setEventCompression. See the documentation of that function for details.

If gdk.types.EventMask.TouchMask is enabled, the window will receive touch events from touch-enabled devices. Those will come as sequences of #GdkEventTouch with type gdk.types.EventType.TouchUpdate, enclosed by two events with type gdk.types.EventType.TouchBegin and gdk.types.EventType.TouchEnd (or gdk.types.EventType.TouchCancel). gdk.event.Event.getEventSequence returns the event sequence for these events, so different sequences may be distinguished.

Values

ValueMeaning
ExposureMask2

receive expose events

PointerMotionMask4

receive all pointer motion events

PointerMotionHintMask8

deprecated. see the explanation above

ButtonMotionMask16

receive pointer motion events while any button is pressed

Button1MotionMask32

receive pointer motion events while 1 button is pressed

Button2MotionMask64

receive pointer motion events while 2 button is pressed

Button3MotionMask128

receive pointer motion events while 3 button is pressed

ButtonPressMask256

receive button press events

ButtonReleaseMask512

receive button release events

KeyPressMask1024

receive key press events

KeyReleaseMask2048

receive key release events

EnterNotifyMask4096

receive window enter events

LeaveNotifyMask8192

receive window leave events

FocusChangeMask16384

receive focus change events

StructureMask32768

receive events about window configuration change

PropertyChangeMask65536

receive property change events

VisibilityNotifyMask131072

receive visibility change events

ProximityInMask262144

receive proximity in events

ProximityOutMask524288

receive proximity out events

SubstructureMask1048576

receive events about window configuration changes of child windows

ScrollMask2097152

receive scroll events

TouchMask4194304

receive touch events. Since 3.4

SmoothScrollMask8388608

receive smooth scrolling events. Since 3.4

TouchpadGestureMask16777216

receive touchpad gesture events. Since 3.18

TabletPadMask33554432

receive tablet pad events. Since 3.22

AllEventsMask67108862

the combination of all the above event masks.