Next: , Previous: ClutterEffect, Up: Top


33 Events

User and window system events

33.1 Overview

Windowing events handled by Clutter.

The events usually come from the windowing backend, but can also be synthesized by Clutter itself or by the application code.

33.2 Usage

— Function: clutter-event-new (type <clutter-event-type>) ⇒  (ret <clutter-event>)

Creates a new <clutter-event> of the specified type.

type
The type of event.
ret
A newly allocated <clutter-event>.
— Function: clutter-event-type (self <clutter-event>) ⇒  (ret <clutter-event-type>)
— Method: type

Retrieves the type of the event.

event
a <clutter-event>
ret
a <clutter-event-type>
— Function: clutter-event-set-coords (self <clutter-event>) (float) (float)
— Method: set-coords

Sets the coordinates of the event.

event
a <clutter-event>
x
the X coordinate of the event
y
the Y coordinate of the event

Since 1.8

— Function: clutter-event-get-coords (self <clutter-event>) ⇒  (float) (float)
— Method: get-coords

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

event
a <clutter-event>
x
return location for the X coordinate, or ‘#f’.
y
return location for the Y coordinate, or ‘#f’.

Since 0.4

— Function: clutter-event-set-state (self <clutter-event>) (state <clutter-modifier-type>)
— Method: set-state

Sets the modifier state of the event.

event
a <clutter-event>
state
the modifier state to set

Since 1.8

— Function: clutter-event-get-state (self <clutter-event>) ⇒  (ret <clutter-modifier-type>)
— Method: get-state

Retrieves the modifier state of the event.

event
a <clutter-event>
ret
the modifier state parameter, or 0

Since 0.4

— Function: clutter-event-set-time (self <clutter-event>) (time_ unsigned-int32)
— Method: set-time

Sets the time of the event.

event
a <clutter-event>
time
the time of the event

Since 1.8

— Function: clutter-event-get-time (self <clutter-event>) ⇒  (ret unsigned-int32)
— Method: get-time

Retrieves the time of the event.

event
a <clutter-event>
ret
the time of the event, or ‘CLUTTER_CURRENT_TIME

Since 0.4

— Function: clutter-event-set-source (self <clutter-event>) (actor <clutter-actor>)
— Method: set-source

Sets the source <clutter-actor> of event.

event
a <clutter-event>
actor
a <clutter-actor>, or ‘#f’.

Since 1.8

— Function: clutter-event-get-source (self <clutter-event>) ⇒  (ret <clutter-actor>)
— Method: get-source

Retrieves the source <clutter-actor> the event originated from, or NULL if the event has no source.

event
a <clutter-event>
ret
a <clutter-actor>.

Since 0.6

— Function: clutter-event-set-stage (self <clutter-event>) (stage <clutter-stage>)
— Method: set-stage

Sets the source <clutter-stage> of the event.

event
a <clutter-event>
stage
a <clutter-stage>, or ‘#f’.

Since 1.8

— Function: clutter-event-get-stage (self <clutter-event>) ⇒  (ret <clutter-stage>)
— Method: get-stage

Retrieves the source <clutter-stage> the event originated for, or ‘#f’ if the event has no stage.

event
a <clutter-event>
ret
a <clutter-stage>.

Since 0.8

— Function: clutter-event-set-flags (self <clutter-event>) (flags <clutter-event-flags>)
— Method: set-flags

Sets the <clutter-event-flags> of event

event
a <clutter-event>
flags
a binary OR of <clutter-event-flags> values

Since 1.8

— Function: clutter-event-get-flags (self <clutter-event>) ⇒  (ret <clutter-event-flags>)
— Method: get-flags

Retrieves the <clutter-event-flags> of event

event
a <clutter-event>
ret
the event flags

Since 1.0

— Function: clutter-event-get-event-sequence (self <clutter-event>) ⇒  (ret <clutter-event-sequence*>)
— Method: get-event-sequence

Retrieves the <clutter-event-sequence> of event.

event
a <clutter-event> of type ‘CLUTTER_TOUCH_BEGIN’, ‘CLUTTER_TOUCH_UPDATE’, ‘CLUTTER_TOUCH_END’, or ‘CLUTTER_TOUCH_CANCEL
ret
the event sequence, or ‘#f’.

Since 1.10

— Function: clutter-event-get ⇒  (ret <clutter-event>)

Pops an event off the event queue. Applications should not need to call this.

ret
A <clutter-event> or NULL if queue empty

Since 0.4

— Function: clutter-event-peek ⇒  (ret <clutter-event>)

Returns a pointer to the first event from the event queue but does not remove it.

ret
A <clutter-event> or NULL if queue empty.

Since 0.4

— Function: clutter-event-put (self <clutter-event>)
— Method: put

Puts a copy of the event on the back of the event queue. The event will have the ‘CLUTTER_EVENT_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

event
a <clutter-event>

Since 0.6

— Function: clutter-events-pending ⇒  (ret bool)

Checks if events are pending in the event queue.

ret
TRUE if there are pending events, FALSE otherwise.

Since 0.4

— Function: clutter-event-set-button (self <clutter-event>) (button unsigned-int32)
— Method: set-button

Sets the button number of event

event
a <clutter-event> or type ‘CLUTTER_BUTTON_PRESS’ or of type ‘CLUTTER_BUTTON_RELEASE
button
the button number

Since 1.8

— Function: clutter-event-get-button (self <clutter-event>) ⇒  (ret unsigned-int32)
— Method: get-button

Retrieves the button number of event

event
a <clutter-event> of type ‘CLUTTER_BUTTON_PRESS’ or of type ‘CLUTTER_BUTTON_RELEASE
ret
the button number

Since 1.0

— Function: clutter-event-get-click-count (self <clutter-event>) ⇒  (ret unsigned-int)
— Method: get-click-count

Retrieves the number of clicks of event

event
a <clutter-event> of type ‘CLUTTER_BUTTON_PRESS’ or of type ‘CLUTTER_BUTTON_RELEASE
ret
the click count

Since 1.0

— Function: clutter-event-set-key-symbol (self <clutter-event>) (key_sym unsigned-int)
— Method: set-key-symbol

Sets the key symbol of event.

event
a <clutter-event> of type ‘CLUTTER_KEY_PRESS’ or ‘CLUTTER_KEY_RELEASE
key-sym
the key symbol representing the key

Since 1.8

— Function: clutter-event-get-key-symbol (self <clutter-event>) ⇒  (ret unsigned-int)
— Method: get-key-symbol

Retrieves the key symbol of event

event
a <clutter-event> of type ‘CLUTTER_KEY_PRESS’ or of type ‘CLUTTER_KEY_RELEASE
ret
the key symbol representing the key

Since 1.0

— Function: clutter-event-set-key-code (self <clutter-event>) (key_code unsigned-int16)
— Method: set-key-code

Sets the keycode of the event.

event
a <clutter-event> of type ‘CLUTTER_KEY_PRESS’ or ‘CLUTTER_KEY_RELEASE
key-code
the keycode representing the key

Since 1.8

— Function: clutter-event-get-key-code (self <clutter-event>) ⇒  (ret unsigned-int16)
— Method: get-key-code

Retrieves the keycode of the key that caused event

event
a <clutter-event> of type ‘CLUTTER_KEY_PRESS’ or of type ‘CLUTTER_KEY_RELEASE
ret
The keycode representing the key

Since 1.0

— Function: clutter-event-set-key-unicode (self <clutter-event>) (key_unicode unsigned-int32)
— Method: set-key-unicode

Sets the Unicode value of event.

event
a <clutter-event> of type ‘CLUTTER_KEY_PRESS’ or ‘CLUTTER_KEY_RELEASE
key-unicode
the Unicode value representing the key

Since 1.8

— Function: clutter-event-get-key-unicode (self <clutter-event>) ⇒  (ret unsigned-int32)
— Method: get-key-unicode

Retrieves the unicode value for the key that caused keyev.

event
a <clutter-event> of type ‘CLUTTER_KEY_PRESS’ or ‘CLUTTER_KEY_RELEASE
ret
The unicode value representing the key
— Function: clutter-keysym-to-unicode (keyval unsigned-int) ⇒  (ret unsigned-int32)

Converts keyval from a Clutter key symbol to the corresponding ISO10646 (Unicode) character.

keyval
a key symbol
ret
a Unicode character, or 0 if there is no corresponding character.
— Function: clutter-unicode-to-keysym (wc unsigned-int32) ⇒  (ret unsigned-int)

Convert from a ISO10646 character to a key symbol.

wc
a ISO10646 encoded character
ret
the corresponding Clutter key symbol, if one exists. or, if there is no corresponding symbol, wc | 0x01000000

Since 1.10

— Function: clutter-event-set-related (self <clutter-event>) (actor <clutter-actor>)
— Method: set-related

Sets the related actor of a crossing event

event
a <clutter-event> of type ‘CLUTTER_ENTER’ or ‘CLUTTER_LEAVE
actor
a <clutter-actor> or ‘#f’.

Since 1.8

— Function: clutter-event-get-related (self <clutter-event>) ⇒  (ret <clutter-actor>)
— Method: get-related

Retrieves the related actor of a crossing event.

event
a <clutter-event> of type ‘CLUTTER_ENTER’ or of type ‘CLUTTER_LEAVE
ret
the related <clutter-actor>, or ‘#f’.

Since 1.0

— Function: clutter-event-set-scroll-direction (self <clutter-event>) (direction <clutter-scroll-direction>)
— Method: set-scroll-direction

Sets the direction of the scrolling of event

event
a <clutter-event>
direction
the scrolling direction

Since 1.8

— Function: clutter-event-get-scroll-delta (self <clutter-event>) ⇒  (dx double) (dy double)
— Method: get-scroll-delta

Retrieves the precise scrolling information of event.

The event has to have a <clutter-scroll-event.direction> value of ‘CLUTTER_SCROLL_SMOOTH’.

event
a <clutter-event> of type ‘CLUTTER_SCROLL
dx
return location for the delta on the horizontal axis.
dy
return location for the delta on the vertical axis.

Since 1.10

— Function: clutter-event-set-scroll-delta (self <clutter-event>) (dx double) (dy double)
— Method: set-scroll-delta

Sets the precise scrolling information of event.

event
a <clutter-event> of type ‘CLUTTER_SCROLL
dx
delta on the horizontal axis
dy
delta on the vertical axis

Since 1.10

— Function: clutter-event-set-device (self <clutter-event>) (device <clutter-input-device*>)
— Method: set-device

Sets the device for event.

event
a <clutter-event>
device
a <clutter-input-device>, or ‘#f’.

Since 1.6

— Function: clutter-event-get-device (self <clutter-event>) ⇒  (ret <clutter-input-device*>)
— Method: get-device

Retrieves the <clutter-input-device> for the event.

The <clutter-input-device> structure is completely opaque and should be cast to the platform-specific implementation.

event
a <clutter-event>
ret
the <clutter-input-device> or ‘#f’. The returned device is owned by the <clutter-event> and it should not be unreferenced.

Since 1.0

— Function: clutter-event-set-source-device (self <clutter-event>) (device <clutter-input-device*>)
— Method: set-source-device

Sets the source <clutter-input-device> for event.

The <clutter-event> must have been created using clutter-event-new.

event
a <clutter-event>
device
a <clutter-input-device>.

Since 1.8

— Function: clutter-event-get-source-device (self <clutter-event>) ⇒  (ret <clutter-input-device*>)
— Method: get-source-device

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.

event
a <clutter-event>
ret
a pointer to a <clutter-input-device> or ‘#f’.

Since 1.6

— Function: clutter-event-get-device-id (self <clutter-event>) ⇒  (ret int)
— Method: get-device-id

Retrieves the events device id if set.

event
a clutter event
ret
A unique identifier for the device or -1 if the event has no specific device set.
— Function: clutter-event-get-device-type (self <clutter-event>) ⇒  (ret <clutter-input-device-type>)
— Method: get-device-type

Retrieves the type of the device for event

event
a <clutter-event>
ret
the <clutter-input-device-type> for the device, if any is set

Since 1.0

— Function: clutter-get-current-event-time ⇒  (ret unsigned-int32)

Retrieves the timestamp of the last event, if there is an event or if the event has a timestamp.

ret
the event timestamp, or ‘CLUTTER_CURRENT_TIME

Since 1.0

— Function: clutter-get-current-event ⇒  (ret <clutter-event>)

If an event is currently being processed, return that event. This function is intended to be used to access event state that might not be exposed by higher-level widgets. For example, to get the key modifier state from a Button 'clicked' event.

ret
The current ClutterEvent, or ‘#f’ if none.

Since 1.2