An input device managed by Clutter
<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.
<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
<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 cursorSince 1.6
<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 deviceSince 1.6
<clutter-input-device*>
) ⇒ (ret bool
)Retrieves whether device is enabled.
- device
- a
<clutter-input-device>
- ret
- ‘
#t
’ if the device is enabledSince 1.6
<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
<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
<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 indexSince 1.6
<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
<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
<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
’ otherwiseSince 1.6
<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