Clutter.Event

Fields

Name

Type

Access

Description

any

Clutter.AnyEvent

r

button

Clutter.ButtonEvent

r

crossing

Clutter.CrossingEvent

r

key

Clutter.KeyEvent

r

motion

Clutter.MotionEvent

r

scroll

Clutter.ScrollEvent

r

stage_state

Clutter.StageStateEvent

r

touch

Clutter.TouchEvent

r

touchpad_pinch

Clutter.TouchpadPinchEvent

r

touchpad_swipe

Clutter.TouchpadSwipeEvent

r

type

Clutter.EventType

r

Methods

class

add_filter (stage, func, *user_data)

class

get ()

class

new (type)

class

peek ()

class

remove_filter (id)

copy ()

free ()

get_angle (target)

get_axes ()

get_button ()

get_click_count ()

get_coords ()

get_device ()

get_device_id ()

get_device_type ()

get_distance (target)

get_event_sequence ()

get_flags ()

get_gesture_motion_delta ()

get_gesture_phase ()

get_gesture_pinch_angle_delta ()

get_gesture_pinch_scale ()

get_gesture_swipe_finger_count ()

get_key_code ()

get_key_symbol ()

get_key_unicode ()

get_position (position)

get_related ()

get_scroll_delta ()

get_scroll_direction ()

get_scroll_finish_flags ()

get_scroll_source ()

get_source ()

get_source_device ()

get_stage ()

get_state ()

get_state_full ()

get_time ()

has_control_modifier ()

has_shift_modifier ()

is_pointer_emulated ()

put ()

set_button (button)

set_coords (x, y)

set_device (device)

set_flags (flags)

set_key_code (key_code)

set_key_symbol (key_sym)

set_key_unicode (key_unicode)

set_related (actor)

set_scroll_delta (dx, dy)

set_scroll_direction (direction)

set_source (actor)

set_source_device (device)

set_stage (stage)

set_state (state)

set_time (time_)

Details

class Clutter.Event
classmethod add_filter(stage, func, *user_data)
Parameters:
Returns:

an identifier for the event filter, to be used with Clutter.Event.remove_filter().

Return type:

int

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 or None if queue empty

Return type:

Clutter.Event

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:

Clutter.Event

Creates a new Clutter.Event of the specified type.

classmethod peek()
Returns:

A Clutter.Event or None if queue empty.

Return type:

Clutter.Event

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 from Clutter.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:

Clutter.Event

Copies self.

free()

Frees all resources used by self.

get_angle(target)
Parameters:

target (Clutter.Event) – a Clutter.Event

Returns:

the angle between two Clutter.Event

Return type:

float

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:

(float, n_axes: int)

Retrieves the array of axes values attached to the event.

New in version 1.6.

get_button()
Returns:

the button number

Return type:

int

Retrieves the button number of self

New in version 1.0.

get_click_count()
Returns:

the click count

Return type:

int

Retrieves the number of clicks of self

New in version 1.0.

get_coords()
Returns:

x:

return location for the X coordinate, or None

y:

return location for the Y coordinate, or None

Return type:

(x: float, y: float)

Retrieves the coordinates of self and puts them into x and y.

New in version 0.4.

get_device()
Returns:

the Clutter.InputDevice or None. The returned device is owned by the Clutter.Event and it should not be unreferenced

Return type:

Clutter.InputDevice

Retrieves the Clutter.InputDevice for the event. If you want the physical device the event originated from, use Clutter.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:

int

Retrieves the events device id if set.

get_device_type()
Returns:

the Clutter.InputDeviceType for the device, if any is set

Return type:

Clutter.InputDeviceType

Retrieves the type of the device for self

New in version 1.0.

get_distance(target)
Parameters:

target (Clutter.Event) – a Clutter.Event

Returns:

the distance between two Clutter.Event

Return type:

float

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:

Clutter.EventSequence

Retrieves the Clutter.EventSequence of self.

New in version 1.10.

get_flags()
Returns:

the event flags

Return type:

Clutter.EventFlags

Retrieves the Clutter.EventFlags of self

New in version 1.0.

get_gesture_motion_delta()
Returns:

dx:

the displacement relative to the pointer position in the X axis, or None

dy:

the displacement relative to the pointer position in the Y axis, or None

Return type:

(dx: float, dy: float)

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:

Clutter.TouchpadGesturePhase

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:

float

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:

float

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:

int

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:

int

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:

int

Retrieves the key symbol of self

New in version 1.0.

get_key_unicode()
Returns:

The unicode value representing the key

Return type:

str

Retrieves the unicode value for the key that caused keyev.

get_position(position)
Parameters:

position (Clutter.Point) – a Clutter.Point

Retrieves the event coordinates as a Clutter.Point.

New in version 1.12.

Returns:

the related Clutter.Actor, or None

Return type:

Clutter.Actor

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:

(dx: float, dy: float)

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:

Clutter.ScrollDirection

Retrieves the direction of the scrolling of self

New in version 1.0.

get_scroll_finish_flags()
Returns:

The scroll finish flags

Return type:

Clutter.ScrollFinishFlags

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:

Clutter.ScrollSource

Returns the Clutter.ScrollSource that applies to an scroll event.

New in version 1.26.

get_source()
Returns:

a Clutter.Actor

Return type:

Clutter.Actor

Retrieves the source Clutter.Actor the event originated from, or None if the event has no source.

New in version 0.6.

get_source_device()
Returns:

a pointer to a Clutter.InputDevice or None

Return type:

Clutter.InputDevice

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:

a Clutter.Stage

Return type:

Clutter.Stage

Retrieves the source Clutter.Stage the event originated for, or None if the event has no stage.

New in version 0.8.

get_state()
Returns:

the modifier state parameter, or 0

Return type:

Clutter.ModifierType

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:

int

Retrieves the time of the event.

New in version 0.4.

has_control_modifier()
Returns:

True if the event has the Control modifier mask set

Return type:

bool

Checks whether self has the Control modifier mask set.

New in version 1.12.

has_shift_modifier()
Returns:

True if the event has the Shift modifier mask set

Return type:

bool

Checks whether self has the Shift modifier mask set.

New in version 1.12.

is_pointer_emulated()
Returns:

True if the event is pointer emulated

Return type:

bool

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 focus

New 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)
Parameters:
  • x (float) – the X coordinate of the event

  • y (float) – the Y coordinate of the event

Sets the coordinates of the self.

New in version 1.8.

set_device(device)
Parameters:

device (Clutter.InputDevice or None) – a Clutter.InputDevice, or None

Sets the device for self.

New in version 1.6.

set_flags(flags)
Parameters:

flags (Clutter.EventFlags) – a binary OR of Clutter.EventFlags values

Sets the Clutter.EventFlags of self

New 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 or None) – a Clutter.Actor or None

Sets the related actor of a crossing event

New in version 1.8.

set_scroll_delta(dx, dy)
Parameters:
  • dx (float) – delta on the horizontal axis

  • dy (float) – delta on the vertical axis

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 or None) – a Clutter.Actor, or None

Sets the source Clutter.Actor of self.

New in version 1.8.

set_source_device(device)
Parameters:

device (Clutter.InputDevice or None) – a Clutter.InputDevice

Sets the source Clutter.InputDevice for self.

The Clutter.Event must have been created using Clutter.Event.new().

New in version 1.8.

set_stage(stage)
Parameters:

stage (Clutter.Stage or None) – a Clutter.Stage, or None

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.

set_time(time_)
Parameters:

time (int) – the time of the event

Sets the time of the event.

New in version 1.8.