Class

Gtk.GestureSingle

Description [src]

final class Gtk.GestureSingle : Gtk.Gesture {
  /* No available fields */
}

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_get_current_sequence() while the gesture is being interacted with.

By default gestures react to both GDK_BUTTON_PRIMARY and touch events, gtk_gesture_single_set_touch_only() can be used to change the touch behavior. Callers may also specify a different mouse button number to interact with through gtk_gesture_single_set_button(), 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_get_current_button().

Ancestors

Instance methods

gtk_gesture_single_get_button

Returns the button number gesture listens for, or 0 if gesture reacts to any button press.

gtk_gesture_single_get_current_button

Returns the button number currently interacting with gesture, or 0 if there is none.

gtk_gesture_single_get_current_sequence

Returns the event sequence currently interacting with gesture. This is only meaningful if gtk_gesture_is_active() returns TRUE.

gtk_gesture_single_get_exclusive

Gets whether a gesture is exclusive. For more information, see gtk_gesture_single_set_exclusive().

gtk_gesture_single_get_touch_only

Returns TRUE if the gesture is only triggered by touch events.

gtk_gesture_single_set_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.

gtk_gesture_single_set_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.

gtk_gesture_single_set_touch_only

If touch_only is TRUE, gesture will only handle events of type

GDK_TOUCH_BEGIN, #GDK_TOUCH_UPDATE or #GDK_TOUCH_END. If FALSE,

mouse events will be handled too.

Properties

Gtk.GestureSingle:button

Mouse button number to listen to, or 0 to listen for any button.

Gtk.GestureSingle:exclusive

Whether the gesture is exclusive. Exclusive gestures only listen to pointer and pointer emulated events.

Gtk.GestureSingle:touch-only

Whether the gesture handles only touch events.

Properties inherited from GtkGesture (1)

Class structure

struct GtkGestureSingleClass {
  /* no available fields */
}