Clutter.Event¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
any |
r |
||
button |
r |
||
crossing |
r |
||
key |
r |
||
motion |
r |
||
scroll |
r |
||
stage_state |
r |
||
touch |
r |
||
touchpad_pinch |
r |
||
touchpad_swipe |
r |
||
type |
r |
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Clutter.Event¶
- classmethod add_filter(stage, func, *user_data)¶
- Parameters:
stage (
Clutter.Stage
orNone
) – TheClutter.Stage
to capture events forfunc (
Clutter.EventFilterFunc
) – The callback function which will be passed all events.user_data (
object
orNone
) – A data pointer to pass to the function.
- Returns:
an identifier for the event filter, to be used with
Clutter.Event.remove_filter
().- Return type:
Adds a function which will be called for all events that Clutter processes. The function will be called before any signals are emitted for the event and it will take precedence over any grabs.
New in version 1.18.
- classmethod get()¶
- Returns:
A
Clutter.Event
orNone
if queue empty- Return type:
Pops an event off the event queue. Applications should not need to call this.
New in version 0.4.
- classmethod new(type)¶
- Parameters:
type (
Clutter.EventType
) – The type of event.- Returns:
A newly allocated
Clutter.Event
.- Return type:
Creates a new
Clutter.Event
of the specified type.
- classmethod peek()¶
- Returns:
A
Clutter.Event
orNone
if queue empty.- Return type:
Returns a pointer to the first event from the event queue but does not remove it.
New in version 0.4.
- classmethod remove_filter(id)¶
- Parameters:
id (
int
) – The ID of the event filter, as returned fromClutter.Event.add_filter
()
Removes an event filter that was previously added with
Clutter.Event.add_filter
().New in version 1.18.
- copy()¶
- Returns:
A newly allocated
Clutter.Event
- Return type:
Copies self.
- free()¶
Frees all resources used by self.
- get_angle(target)¶
- Parameters:
target (
Clutter.Event
) – aClutter.Event
- Returns:
the angle between two
Clutter.Event
- Return type:
Retrieves the angle relative from self to target.
The direction of the angle is from the position X axis towards the positive Y axis.
New in version 1.12.
- get_axes()¶
- Returns:
an array of axis values
- n_axes:
return location for the number of axes returned
- Return type:
Retrieves the array of axes values attached to the event.
New in version 1.6.
- get_button()¶
- Returns:
the button number
- Return type:
Retrieves the button number of self
New in version 1.0.
- get_click_count()¶
- Returns:
the click count
- Return type:
Retrieves the number of clicks of self
New in version 1.0.
- get_coords()¶
- Returns:
- Return type:
Retrieves the coordinates of self and puts them into x and y.
New in version 0.4.
- get_device()¶
- Returns:
the
Clutter.InputDevice
orNone
. The returned device is owned by theClutter.Event
and it should not be unreferenced- Return type:
Retrieves the
Clutter.InputDevice
for the event. If you want the physical device the event originated from, useClutter.Event.get_source_device
().The
Clutter.InputDevice
structure is completely opaque and should be cast to the platform-specific implementation.New in version 1.0.
- get_device_id()¶
- Returns:
A unique identifier for the device or -1 if the event has no specific device set.
- Return type:
Retrieves the events device id if set.
- get_device_type()¶
- Returns:
the
Clutter.InputDeviceType
for the device, if any is set- Return type:
Retrieves the type of the device for self
New in version 1.0.
- get_distance(target)¶
- Parameters:
target (
Clutter.Event
) – aClutter.Event
- Returns:
the distance between two
Clutter.Event
- Return type:
Retrieves the distance between two events, a self and a target.
New in version 1.12.
- get_event_sequence()¶
- Returns:
the event sequence, or
None
- Return type:
Retrieves the
Clutter.EventSequence
of self.New in version 1.10.
- get_flags()¶
- Returns:
the event flags
- Return type:
Retrieves the
Clutter.EventFlags
of selfNew in version 1.0.
- get_gesture_motion_delta()¶
- Returns:
- Return type:
Returns the gesture motion deltas relative to the current pointer position.
New in version 1.24.
- get_gesture_phase()¶
- Returns:
the phase of the gesture event.
- Return type:
Returns the phase of the event, See
Clutter.TouchpadGesturePhase
.
- get_gesture_pinch_angle_delta()¶
- Returns:
The angle delta relative to the previous event.
- Return type:
Returns the angle delta reported by this specific event.
New in version 1.24.
- get_gesture_pinch_scale()¶
- Returns:
the current pinch gesture scale
- Return type:
Returns the current scale as reported by self, 1.0 being the original distance at the time the corresponding event with phase
Clutter.TouchpadGesturePhase.BEGIN
is received. is received.New in version 1.24.
- get_gesture_swipe_finger_count()¶
- Returns:
the number of fingers swiping.
- Return type:
Returns the number of fingers that is triggering the touchpad gesture.
New in version 1.24.
- get_key_code()¶
- Returns:
The keycode representing the key
- Return type:
Retrieves the keycode of the key that caused self
New in version 1.0.
- get_key_symbol()¶
- Returns:
the key symbol representing the key
- Return type:
Retrieves the key symbol of self
New in version 1.0.
- get_key_unicode()¶
- Returns:
The unicode value representing the key
- Return type:
Retrieves the unicode value for the key that caused keyev.
- get_position(position)¶
- Parameters:
position (
Clutter.Point
) – aClutter.Point
Retrieves the event coordinates as a
Clutter.Point
.New in version 1.12.
- Returns:
the related
Clutter.Actor
, orNone
- Return type:
Retrieves the related actor of a crossing event.
New in version 1.0.
- get_scroll_delta()¶
- Returns:
- dx:
return location for the delta on the horizontal axis
- dy:
return location for the delta on the vertical axis
- Return type:
Retrieves the precise scrolling information of self.
The self has to have a Clutter.ScrollEvent.direction value of
Clutter.ScrollDirection.SMOOTH
.New in version 1.10.
- get_scroll_direction()¶
- Returns:
the scrolling direction
- Return type:
Retrieves the direction of the scrolling of self
New in version 1.0.
- get_scroll_finish_flags()¶
- Returns:
The scroll finish flags
- Return type:
Returns the
Clutter.ScrollFinishFlags
of an scroll event. Those can be used to determine whether post-scroll effects like kinetic scrolling should be applied.New in version 1.26.
- get_scroll_source()¶
- Returns:
The source of scroll events
- Return type:
Returns the
Clutter.ScrollSource
that applies to an scroll event.New in version 1.26.
- get_source()¶
- Returns:
- Return type:
Retrieves the source
Clutter.Actor
the event originated from, orNone
if the event has no source.New in version 0.6.
- get_source_device()¶
- Returns:
a pointer to a
Clutter.InputDevice
orNone
- Return type:
Retrieves the hardware device that originated the event.
If you need the virtual device, use
Clutter.Event.get_device
().If no hardware device originated this event, this function will return the same device as
Clutter.Event.get_device
().New in version 1.6.
- get_stage()¶
- Returns:
- Return type:
Retrieves the source
Clutter.Stage
the event originated for, orNone
if the event has no stage.New in version 0.8.
- get_state()¶
- Returns:
the modifier state parameter, or 0
- Return type:
Retrieves the modifier state of the event. In case the window system supports reporting latched and locked modifiers, this function returns the effective state.
New in version 0.4.
- get_state_full()¶
- Returns:
- button_state:
the pressed buttons as a mask
- base_state:
the regular pressed modifier keys
- latched_state:
the latched modifier keys (currently released but still valid for one key press/release)
- locked_state:
the locked modifier keys (valid until the lock key is pressed and released again)
- effective_state:
the logical OR of all the state bits above
- Return type:
(button_state:
Clutter.ModifierType
, base_state:Clutter.ModifierType
, latched_state:Clutter.ModifierType
, locked_state:Clutter.ModifierType
, effective_state:Clutter.ModifierType
)
Retrieves the decomposition of the keyboard state into button, base, latched, locked and effective. This can be used to transmit to other applications, for example when implementing a wayland compositor.
New in version 1.16.
- get_time()¶
- Returns:
the time of the event, or
Clutter.CURRENT_TIME
- Return type:
Retrieves the time of the event.
New in version 0.4.
- has_control_modifier()¶
-
Checks whether self has the Control modifier mask set.
New in version 1.12.
- has_shift_modifier()¶
-
Checks whether self has the Shift modifier mask set.
New in version 1.12.
- is_pointer_emulated()¶
-
Checks whether a pointer self has been generated by the windowing system. The returned value can be used to distinguish between events synthesized by the windowing system itself (as opposed by Clutter).
New in version 1.12.
- put()¶
Puts a copy of the event on the back of the event queue. The event will have the
Clutter.EventFlags.FLAG_SYNTHETIC
flag set. If the source is set event signals will be emitted for this source and capture/bubbling for its ancestors. If the source is not set it will be generated by picking or use the actor that currently has keyboard focusNew in version 0.6.
- set_button(button)¶
- Parameters:
button (
int
) – the button number
Sets the button number of self
New in version 1.8.
- set_coords(x, y)¶
-
Sets the coordinates of the self.
New in version 1.8.
- set_device(device)¶
- Parameters:
device (
Clutter.InputDevice
orNone
) – aClutter.InputDevice
, orNone
Sets the device for self.
New in version 1.6.
- set_flags(flags)¶
- Parameters:
flags (
Clutter.EventFlags
) – a binary OR ofClutter.EventFlags
values
Sets the
Clutter.EventFlags
of selfNew in version 1.8.
- set_key_code(key_code)¶
- Parameters:
key_code (
int
) – the keycode representing the key
Sets the keycode of the self.
New in version 1.8.
- set_key_symbol(key_sym)¶
- Parameters:
key_sym (
int
) – the key symbol representing the key
Sets the key symbol of self.
New in version 1.8.
- set_key_unicode(key_unicode)¶
- Parameters:
key_unicode (
str
) – the Unicode value representing the key
Sets the Unicode value of self.
New in version 1.8.
- Parameters:
actor (
Clutter.Actor
orNone
) – aClutter.Actor
orNone
Sets the related actor of a crossing event
New in version 1.8.
- set_scroll_delta(dx, dy)¶
-
Sets the precise scrolling information of self.
New in version 1.10.
- set_scroll_direction(direction)¶
- Parameters:
direction (
Clutter.ScrollDirection
) – the scrolling direction
Sets the direction of the scrolling of self
New in version 1.8.
- set_source(actor)¶
- Parameters:
actor (
Clutter.Actor
orNone
) – aClutter.Actor
, orNone
Sets the source
Clutter.Actor
of self.New in version 1.8.
- set_source_device(device)¶
- Parameters:
device (
Clutter.InputDevice
orNone
) – aClutter.InputDevice
Sets the source
Clutter.InputDevice
for self.The
Clutter.Event
must have been created usingClutter.Event.new
().New in version 1.8.
- set_stage(stage)¶
- Parameters:
stage (
Clutter.Stage
orNone
) – aClutter.Stage
, orNone
Sets the source
Clutter.Stage
of the event.New in version 1.8.
- set_state(state)¶
- Parameters:
state (
Clutter.ModifierType
) – the modifier state to set
Sets the modifier state of the event.
New in version 1.8.