gtk.gesture_single

Module for [GestureSingle] class

Types 3

#GtkGestureSingle is a subclass of #GtkGesture, optimized (although not restricted) for dealing with mouse and single-touch gestures. Under interaction, these gestures stick to the first interacting sequence, which is accessible through [gtk.gesture_single.GestureSingle.getCurrentSequence] while the gesture is being interacted with.

By default gestures react to both [gdk.types.BUTTON_PRIMARY] and touch events, [gtk.gesture_single.GestureSingle.setTouchOnly] can be used to change the touch behavior. Callers may also specify a different mouse button number to interact with through [gtk.gesture_single.GestureSingle.setButton], or react to any mouse button by setting 0. While the gesture is active, the button being currently pressed can be known through [gtk.gesture_single.GestureSingle.getCurrentButton].

Methods
GType _gType() @property
GestureSingle self()Returns `this`, for use in `with` statements.
GestureSingleGidBuilder builder()Get builder for [gtk.gesture_single.GestureSingle] Returns: New builder object
uint button() @propertyGet `button` property. Returns: Mouse button number to listen to, or 0 to listen for any button.
void button(uint propval) @propertySet `button` property. Params: propval = Mouse button number to listen to, or 0 to listen for any button.
bool exclusive() @propertyGet `exclusive` property. Returns: Whether the gesture is exclusive. Exclusive gestures only listen to pointer and pointer emulated events.
void exclusive(bool propval) @propertySet `exclusive` property. Params: propval = Whether the gesture is exclusive. Exclusive gestures only listen to pointer and pointer emulated events.
bool touchOnly() @propertyGet `touchOnly` property. Returns: Whether the gesture handles only touch events.
void touchOnly(bool propval) @propertySet `touchOnly` property. Params: propval = Whether the gesture handles only touch events.
uint getButton()Returns the button number gesture listens for, or 0 if gesture reacts to any button press. Returns: The button number, or 0 for any button
uint getCurrentButton()Returns the button number currently interacting with gesture, or 0 if there is none. Returns: The current button number
gdk.event_sequence.EventSequence getCurrentSequence()Returns the event sequence currently interacting with gesture. This is only meaningful if [gtk.gesture.Gesture.isActive] returns true. Returns: the current sequence
bool getExclusive()Gets whether a gesture is exclusive. For more information, see [gtk.gesture_single.GestureSingle.setExclusive]. Returns: Whether the gesture is exclusive
bool getTouchOnly()Returns true if the gesture is only triggered by touch events. Returns: true if the gesture only handles touch events
void setButton(uint button)Sets the button number gesture listens to. If non-0, every button press from a different button number will be ignored. Touch events implicitly match with button 1.
void setExclusive(bool exclusive)Sets whether gesture is exclusive. An exclusive gesture will only handle pointer and "pointer emulated" touch events, so at any given time, there is only one sequence able to interact with those.
void setTouchOnly(bool touchOnly)If touchonly is true, gesture will only handle events of type #GDKTOUCHBEGIN, #GDKTOUCHUPDATE or #GDKTOUCH_END. If false, mouse events will be handled too.
Constructors
this(void * ptr, Flag!"Take" take)
Methods
T button(uint propval)Set `button` property. Params: propval = Mouse button number to listen to, or 0 to listen for any button. Returns: Builder instance for fluent chaining
T exclusive(bool propval)Set `exclusive` property. Params: propval = Whether the gesture is exclusive. Exclusive gestures only listen to pointer and pointer emulated events. Returns: Builder instance for fluent chaining
T touchOnly(bool propval)Set `touchOnly` property. Params: propval = Whether the gesture handles only touch events. Returns: Builder instance for fluent chaining

Fluent builder for [gtk.gesture_single.GestureSingle]