Class: Clutter::InputDevice
- Inherits:
-
Object
- Object
- Clutter::InputDevice
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#associated_device ⇒ Clutter::InputDevice
Retrieves a pointer to the Clutter::InputDevice that has been associated to device.
-
#backend ⇒ Clutter::Backend
The Clutter::Backend that created the device.
-
#backend=(backend) ⇒ Clutter::Backend
The Clutter::Backend that created the device.
-
#device_id ⇒ Integer
Retrieves the unique identifier of device.
-
#device_manager ⇒ Clutter::DeviceManager
The Clutter::DeviceManager instance which owns the device.
-
#device_manager=(device_manager) ⇒ Clutter::DeviceManager
The Clutter::DeviceManager instance which owns the device.
-
#device_mode ⇒ Clutter::InputMode
Device-mode.
- #device_mode=(device_mode) ⇒ Clutter::InputMode
-
#device_name ⇒ String
Retrieves the name of the device.
-
#device_type ⇒ Clutter::InputDeviceType
The type of the device.
-
#device_type=(device_type) ⇒ Clutter::InputDeviceType
The type of the device.
-
#enabled ⇒ Boolean
Retrieves whether device is enabled.
-
#enabled=(enabled) ⇒ Boolean
Whether the device is enabled.
-
#enabled? ⇒ Boolean
Whether the device is enabled.
-
#get_axis(index_) ⇒ Clutter::InputAxis
Retrieves the type of axis on device at the given index.
-
#get_axis_value(axes, axis, value) ⇒ Boolean
Extracts the value of the given axis of a Clutter::InputDevice from an array of axis values.
-
#get_coords(sequence, point) ⇒ Boolean
Retrieves the latest coordinates of a pointer or touch point of device.
-
#get_device_coords(x, y) ⇒ nil
Retrieves the latest coordinates of the pointer of device.
-
#get_key(index_, keyval, modifiers) ⇒ Boolean
Retrieves the key set using clutter_input_device_set_key().
-
#grab(actor) ⇒ nil
Acquires a grab on actor for the given device.
-
#grabbed_actor ⇒ Clutter::Actor
Retrieves a pointer to the Clutter::Actor currently grabbing all the events coming from device.
-
#has_cursor ⇒ Boolean
Retrieves whether device has a pointer that follows the device motion.
-
#has_cursor=(has_cursor) ⇒ Boolean
Whether the device has an on screen cursor following its movement.
-
#has_cursor? ⇒ Boolean
Whether the device has an on screen cursor following its movement.
-
#id ⇒ Integer
The unique identifier of the device.
-
#id=(id) ⇒ Integer
The unique identifier of the device.
-
#keycode_to_evdev(hardware_keycode, evdev_keycode) ⇒ Boolean
Translates a hardware keycode from a Clutter::KeyEvent to the equivalent evdev keycode.
-
#modifier_state ⇒ Clutter::ModifierType
Retrieves the current modifiers state of the device, as seen by the last event Clutter processed.
-
#n_axes ⇒ Integer
The number of axes of the device.
-
#n_axes=(n_axes) ⇒ Integer
The number of axes of the device.
-
#n_keys ⇒ Integer
Retrieves the number of keys registered for device.
-
#name ⇒ String
The name of the device.
-
#name=(name) ⇒ String
The name of the device.
-
#pointer_actor ⇒ Clutter::Actor
Retrieves the Clutter::Actor underneath the pointer of device.
-
#pointer_stage ⇒ Clutter::Stage
Retrieves the Clutter::Stage underneath the pointer of device.
-
#product_id ⇒ String
Product ID of this device.
-
#product_id=(product_id) ⇒ String
Product ID of this device.
-
#sequence_get_grabbed_actor(sequence) ⇒ Clutter::Actor
Retrieves a pointer to the Clutter::Actor currently grabbing the touch events coming from device given the sequence.
-
#sequence_grab(sequence, actor) ⇒ nil
Acquires a grab on actor for the given device and the given touch sequence.
-
#sequence_ungrab(sequence) ⇒ nil
Releases the grab on the device for the given sequence, if one is in place.
-
#set_key(index_, keyval, modifiers) ⇒ nil
Sets the keyval and modifiers at the given index_ for device.
-
#slave_devices ⇒ GLib::List<Clutter::InputDevice>
Retrieves the slave devices attached to device.
-
#ungrab ⇒ nil
Releases the grab on the device, if one is in place.
-
#update_from_event(event, update_stage) ⇒ nil
Forcibly updates the state of the device using a Clutter::Event.
-
#vendor_id ⇒ String
Vendor ID of this device.
-
#vendor_id=(vendor_id) ⇒ String
Vendor ID of this device.
Instance Method Details
#associated_device ⇒ Clutter::InputDevice
Retrieves a pointer to the Clutter::InputDevice that has been associated to device.
If the Clutter::InputDevice:device-mode property of device is set to %CLUTTER_INPUT_MODE_MASTER, this function will return nil.
#backend ⇒ Clutter::Backend
The Clutter::Backend that created the device.
#backend=(backend) ⇒ Clutter::Backend
The Clutter::Backend that created the device.
#device_id ⇒ Integer
Retrieves the unique identifier of device
#device_manager ⇒ Clutter::DeviceManager
The Clutter::DeviceManager instance which owns the device
#device_manager=(device_manager) ⇒ Clutter::DeviceManager
The Clutter::DeviceManager instance which owns the device
#device_mode ⇒ Clutter::InputMode
Returns device-mode.
#device_mode=(device_mode) ⇒ Clutter::InputMode
#device_name ⇒ String
Retrieves the name of the device
#device_type ⇒ Clutter::InputDeviceType
The type of the device
#device_type=(device_type) ⇒ Clutter::InputDeviceType
The type of the device
#enabled ⇒ Boolean
Retrieves whether device is enabled.
#enabled=(enabled) ⇒ Boolean
Whether the device is enabled.
A device with the Clutter::InputDevice:device-mode property set to %CLUTTER_INPUT_MODE_MASTER cannot be disabled.
A device must be enabled in order to receive events from it.
#enabled? ⇒ Boolean
Whether the device is enabled.
A device with the Clutter::InputDevice:device-mode property set to %CLUTTER_INPUT_MODE_MASTER cannot be disabled.
A device must be enabled in order to receive events from it.
#get_axis(index_) ⇒ Clutter::InputAxis
Retrieves the type of axis on device at the given index.
#get_axis_value(axes, axis, value) ⇒ Boolean
Extracts the value of the given axis of a Clutter::InputDevice 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); ]|
#get_coords(sequence, point) ⇒ Boolean
Retrieves the latest coordinates of a pointer or touch point of device.
#get_device_coords(x, y) ⇒ nil
Retrieves the latest coordinates of the pointer of device
#get_key(index_, keyval, modifiers) ⇒ Boolean
Retrieves the key set using clutter_input_device_set_key()
#grab(actor) ⇒ nil
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::InputDevice of types %CLUTTER_POINTER_DEVICE and %CLUTTER_KEYBOARD_DEVICE can hold a grab.
#grabbed_actor ⇒ Clutter::Actor
Retrieves a pointer to the Clutter::Actor currently grabbing all the events coming from device.
#has_cursor ⇒ Boolean
Retrieves whether device has a pointer that follows the device motion.
#has_cursor=(has_cursor) ⇒ Boolean
Whether the device has an on screen cursor following its movement.
#has_cursor? ⇒ Boolean
Whether the device has an on screen cursor following its movement.
#id ⇒ Integer
The unique identifier of the device
#id=(id) ⇒ Integer
The unique identifier of the device
#keycode_to_evdev(hardware_keycode, evdev_keycode) ⇒ Boolean
Translates a hardware keycode from a Clutter::KeyEvent to the equivalent evdev keycode. Note that depending on the input backend used by Clutter this function can fail if there is no obvious mapping between the key codes. The hardware keycode can be taken from the Clutter::KeyEvent.hardware_keycode member of #ClutterKeyEvent.
#modifier_state ⇒ Clutter::ModifierType
Retrieves the current modifiers state of the device, as seen by the last event Clutter processed.
#n_axes ⇒ Integer
The number of axes of the device.
#n_axes=(n_axes) ⇒ Integer
The number of axes of the device.
#n_keys ⇒ Integer
Retrieves the number of keys registered for device.
#name ⇒ String
The name of the device
#name=(name) ⇒ String
The name of the device
#pointer_actor ⇒ Clutter::Actor
Retrieves the Clutter::Actor underneath the pointer of device
#pointer_stage ⇒ Clutter::Stage
Retrieves the Clutter::Stage underneath the pointer of device
#product_id ⇒ String
Product ID of this device.
#product_id=(product_id) ⇒ String
Product ID of this device.
#sequence_get_grabbed_actor(sequence) ⇒ Clutter::Actor
Retrieves a pointer to the Clutter::Actor currently grabbing the touch events coming from device given the sequence.
#sequence_grab(sequence, actor) ⇒ nil
Acquires a grab on actor for the given device and the given touch sequence.
Any touch event coming from device and from sequence will be delivered to actor, bypassing the usual event delivery mechanism, until the grab is released by calling clutter_input_device_sequence_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.
#sequence_ungrab(sequence) ⇒ nil
Releases the grab on the device for the given sequence, if one is in place.
#set_key(index_, keyval, modifiers) ⇒ nil
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.
#slave_devices ⇒ GLib::List<Clutter::InputDevice>
Retrieves the slave devices attached to device.
#ungrab ⇒ nil
Releases the grab on the device, if one is in place.
#update_from_event(event, update_stage) ⇒ nil
Forcibly updates the state of the device using a Clutter::Event
This function should never be used by applications: it is meant for integration with embedding toolkits, like clutter-gtk
Embedding toolkits that disable the event collection inside Clutter need to use this function to update the state of input devices depending on a Clutter::Event that they are going to submit to the event handling code in Clutter though clutter_do_event(). Since the input devices hold the state that is going to be used to fill in fields like the Clutter::ButtonEvent click count, or to emit synthesized events like %CLUTTER_ENTER and %CLUTTER_LEAVE, it is necessary for embedding toolkits to also be responsible of updating the input device state.
For instance, this might be the code to translate an embedding toolkit native motion notification into a Clutter Clutter::MotionEvent and ask Clutter to process it:
|[ ClutterEvent c_event;
translate_native_event_to_clutter (native_event, &c_event);
clutter_do_event (&c_event); ]|
Before letting clutter_do_event() process the event, it is necessary to call clutter_input_device_update_from_event():
|[ ClutterEvent c_event; ClutterDeviceManager *manager; ClutterInputDevice *device;
translate_native_event_to_clutter (native_event, &c_event);
// get the device manager manager = clutter_device_manager_get_default ();
// use the default Core Pointer that Clutter backends register by default device = clutter_device_manager_get_core_device (manager, %CLUTTER_POINTER_DEVICE);
// update the state of the input device clutter_input_device_update_from_event (device, &c_event, FALSE);
clutter_do_event (&c_event); ]|
The update_stage boolean argument should be used when the input device enters and leaves a Clutter::Stage; it will use the #ClutterStage field of the passed event to update the stage associated to the input device.
#vendor_id ⇒ String
Vendor ID of this device.
#vendor_id=(vendor_id) ⇒ String
Vendor ID of this device.