Next: , Previous: ClutterGestureAction, Up: Top


39 ClutterInputDevice

An input device managed by Clutter

39.1 Overview

<clutter-input-device> represents an input device known to Clutter.

The <clutter-input-device> class holds the state of the device, but its contents are usually defined by the Clutter backend in use.

39.2 Usage

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

Retrieves the unique identifier of device

device
a <clutter-input-device>
ret
the identifier of the device

Since 1.0

— Function: clutter-input-device-get-has-cursor (self <clutter-input-device*>) ⇒  (ret bool)

Retrieves whether device has a pointer that follows the device motion.

device
a <clutter-input-device>
ret
#t’ if the device has a cursor

Since 1.6

— Function: clutter-input-device-set-enabled (self <clutter-input-device*>) (enabled bool)

Enables or disables a <clutter-input-device>.

Only devices with a <"device-mode"> property set to ‘CLUTTER_INPUT_MODE_SLAVE’ or ‘CLUTTER_INPUT_MODE_FLOATING’ can be disabled.

device
a <clutter-input-device>
enabled
#t’ to enable the device

Since 1.6

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

Retrieves whether device is enabled.

device
a <clutter-input-device>
ret
#t’ if the device is enabled

Since 1.6

— Function: clutter-input-device-get-n-keys (self <clutter-input-device*>) ⇒  (ret unsigned-int)

Retrieves the number of keys registered for device.

device
a <clutter-input-device>
ret
the number of registered keys

Since 1.6

— Function: clutter-input-device-set-key (self <clutter-input-device*>) (index_ unsigned-int) (keyval unsigned-int) (modifiers <clutter-modifier-type>)

Sets the keyval and modifiers at the given index for device.

Clutter will use the keyval and modifiers set when filling out an event coming from the same input device.

device
a <clutter-input-device>
index
the index of the key
keyval
the keyval
modifiers
a bitmask of modifiers

Since 1.6

— Function: clutter-input-device-get-key (self <clutter-input-device*>) (index_ unsigned-int) ⇒  (ret bool) (keyval unsigned-int) (modifiers <clutter-modifier-type>)

Retrieves the key set using clutter-input-device-set-key

device
a <clutter-input-device>
index
the index of the key
keyval
return location for the keyval at index.
modifiers
return location for the modifiers at index.
ret
#t’ if a key was set at the given index

Since 1.6

— Function: clutter-input-device-get-n-axes (self <clutter-input-device*>) ⇒  (ret unsigned-int)

Retrieves the number of axes available on device.

device
a <clutter-input-device>
ret
the number of axes on the device

Since 1.6

— Function: clutter-input-device-get-axis (self <clutter-input-device*>) (index_ unsigned-int) ⇒  (ret <clutter-input-axis>)

Retrieves the type of axis on device at the given index.

device
a <clutter-input-device>
index
the index of the axis
ret
the axis type

Since 1.6

— Function: clutter-input-device-get-axis-value (self <clutter-input-device*>) (axis <clutter-input-axis>) ⇒  (ret bool) (axes double) (value double)

Extracts the value of the given axis of a <clutter-input-device> from an array of axis values.

An example of typical usage for this function is:

          
            ClutterInputDevice *device = clutter_event_get_device (event);
            gdouble *axes = clutter_event_get_axes (event, NULL);
            gdouble pressure_value = 0;
          
            clutter_input_device_get_axis_value (device, axes,
                                                 CLUTTER_INPUT_AXIS_PRESSURE,
                                                 &pressure_value);
device
a <clutter-input-device>
axes
an array of axes values, typically coming from clutter-event-get-axes.
axis
the axis to extract
value
return location for the axis value.
ret
#t’ if the value was set, and ‘#f’ otherwise

Since 1.6

— Function: clutter-input-device-grab (self <clutter-input-device*>) (actor <clutter-actor>)

Acquires a grab on actor for the given device.

Any event coming from device will be delivered to actor, bypassing the usual event delivery mechanism, until the grab is released by calling clutter-input-device-ungrab.

The grab is client-side: even if the windowing system used by the Clutter backend has the concept of "device grabs", Clutter will not use them.

Only <clutter-input-device> of types ‘CLUTTER_POINTER_DEVICE’ and ‘CLUTTER_KEYBOARD_DEVICE’ can hold a grab.

device
a <clutter-input-device>
actor
a <clutter-actor>

Since 1.10

— Function: clutter-input-device-ungrab (self <clutter-input-device*>)

Releases the grab on the device, if one is in place.

device
a <clutter-input-device>

Since 1.10