Gtk.GestureSingle¶
- Subclasses:
Gtk.DragSource
,Gtk.GestureClick
,Gtk.GestureDrag
,Gtk.GestureLongPress
,Gtk.GestureStylus
,Gtk.GestureSwipe
Methods¶
- Inherited:
Gtk.Gesture (17), Gtk.EventController (13), GObject.Object (37)
- Structs:
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.GestureSingle(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GtkGestureSingle
is aGtkGestures
subclass optimized for singe-touch and mouse gestures.Under interaction, these gestures stick to the first interacting sequence, which is accessible through [method`Gtk`.GestureSingle.get_current_sequence] while the gesture is being interacted with.
By default gestures react to both
Gdk.BUTTON_PRIMARY
and touch events. [method`Gtk`.GestureSingle.set_touch_only] can be used to change the touch behavior. Callers may also specify a different mouse button number to interact with through [method`Gtk`.GestureSingle.set_button], or react to any mouse button by setting it to 0. While the gesture is active, the button being currently pressed can be known through [method`Gtk`.GestureSingle.get_current_button].- get_button()[source]¶
- Returns:
The button number, or 0 for any button
- Return type:
Returns the button number self listens for.
If this is 0, the gesture reacts to any button press.
- get_current_button()[source]¶
- Returns:
The current button number
- Return type:
Returns the button number currently interacting with self, or 0 if there is none.
- get_current_sequence()[source]¶
- Returns:
the current sequence
- Return type:
Returns the event sequence currently interacting with self.
This is only meaningful if [method`Gtk`.Gesture.is_active] returns
True
.
- get_exclusive()[source]¶
- Returns:
Whether the gesture is exclusive
- Return type:
Gets whether a gesture is exclusive.
For more information, see [method`Gtk`.GestureSingle.set_exclusive].
- set_button(button)[source]¶
- Parameters:
button (
int
) – button number to listen to, or 0 for any button
Sets the button number self listens to.
If non-0, every button press from a different button number will be ignored. Touch events implicitly match with button 1.
- set_exclusive(exclusive)[source]¶
-
Sets whether self 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.
- set_touch_only(touch_only)[source]¶
- Parameters:
touch_only (
bool
) – whether self handles only touch events
Sets whether to handle only touch events.
If touch_only is
True
, self will only handle events of typeGdk.EventType.TOUCH_BEGIN
,Gdk.EventType.TOUCH_UPDATE
orGdk.EventType.TOUCH_END
. IfFalse
, mouse events will be handled too.
Property Details¶
- Gtk.GestureSingle.props.button¶
- Name:
button
- Type:
- Default Value:
1
- Flags:
Mouse button number to listen to, or 0 to listen for any button.
- Gtk.GestureSingle.props.exclusive¶
- Name:
exclusive
- Type:
- Default Value:
- Flags:
Whether the gesture is exclusive.
Exclusive gestures only listen to pointer and pointer emulated events.