Class

GdkDevice

Description [src]

abstract class Gdk.Device : GObject.Object {
  /* No available fields */
}

The GdkDevice object represents a single input device, such as a keyboard, a mouse, a touchpad, etc.

See the GdkDeviceManager documentation for more information about the various kinds of master and slave devices, and their relationships.

Hierarchy

hierarchy this GdkDevice ancestor_0 GObject ancestor_0--this

Ancestors

Functions

gdk_device_free_history

Frees an array of GdkTimeCoord that was returned by gdk_device_get_history().

gdk_device_grab_info_libgtk_only

Determines information about the current keyboard grab. This is not public API and must not be used by applications.

Deprecated since: 3.16

Instance methods

gdk_device_get_associated_device

Returns the associated device to device, if device is of type GDK_DEVICE_TYPE_MASTER, it will return the paired pointer or keyboard.

Available since: 3.0

gdk_device_get_axes

Returns the axes currently available on the device.

Available since: 3.22

gdk_device_get_axis

Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis use.

gdk_device_get_axis_use

Returns the axis use for index_.

Available since: 2.20

gdk_device_get_axis_value

Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis label, as returned by gdk_device_list_axes()

Available since: 3.0

gdk_device_get_device_type

Returns the device type for device.

Available since: 3.0

gdk_device_get_display

Returns the GdkDisplay to which device pertains.

Available since: 3.0

gdk_device_get_has_cursor

Determines whether the pointer follows device motion. This is not meaningful for keyboard devices, which don’t have a pointer.

Available since: 2.20

gdk_device_get_history

Obtains the motion history for a pointer device; given a starting and ending timestamp, return all events in the motion history for the device in the given range of time. Some windowing systems do not support motion history, in which case, FALSE will be returned. (This is not distinguishable from the case where motion history is supported and no events were found.)

gdk_device_get_key

If index_ has a valid keyval, this function will return TRUE and fill in keyval and modifiers with the keyval settings.

Available since: 2.20

gdk_device_get_last_event_window

Gets information about which window the given pointer device is in, based on events that have been received so far from the display server. If another application has a pointer grab, or this application has a grab with owner_events = FALSE, NULL may be returned even if the pointer is physically over one of this application’s windows.

Available since: 3.12

gdk_device_get_mode

Determines the mode of the device.

Available since: 2.20

gdk_device_get_n_axes

Returns the number of axes the device currently has.

Available since: 3.0

gdk_device_get_n_keys

Returns the number of keys the device currently has.

Available since: 2.24

gdk_device_get_name

Determines the name of the device.

Available since: 2.20

gdk_device_get_position

Gets the current location of device. As a slave device coordinates are those of its master pointer, This function may not be called on devices of type GDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them, see gdk_device_grab().

Available since: 3.0

gdk_device_get_position_double

Gets the current location of device in double precision. As a slave device’s coordinates are those of its master pointer, this function may not be called on devices of type GDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them. See gdk_device_grab().

Available since: 3.10

gdk_device_get_product_id

Returns the product ID of this device, or NULL if this information couldn’t be obtained. This ID is retrieved from the device, and is thus constant for it. See gdk_device_get_vendor_id() for more information.

Available since: 3.16

gdk_device_get_seat

Returns the GdkSeat the device belongs to.

Available since: 3.20

gdk_device_get_source

Determines the type of the device.

Available since: 2.20

gdk_device_get_state

Gets the current state of a pointer device relative to window. As a slave device’s coordinates are those of its master pointer, this function may not be called on devices of type GDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them. See gdk_device_grab().

gdk_device_get_vendor_id

Returns the vendor ID of this device, or NULL if this information couldn’t be obtained. This ID is retrieved from the device, and is thus constant for it.

Available since: 3.16

gdk_device_get_window_at_position

Obtains the window underneath device, returning the location of the device in win_x and win_y. Returns NULL if the window tree under device is not known to GDK (for example, belongs to another application).

Available since: 3.0

gdk_device_get_window_at_position_double

Obtains the window underneath device, returning the location of the device in win_x and win_y in double precision. Returns NULL if the window tree under device is not known to GDK (for example, belongs to another application).

Available since: 3.0

gdk_device_grab

Grabs the device so that all events coming from this device are passed to this application until the device is ungrabbed with gdk_device_ungrab(), or the window becomes unviewable. This overrides any previous grab on the device by this client.

Available since: 3.0

Deprecated since: 3.20.

gdk_device_list_axes

Returns a GList of GdkAtoms, containing the labels for the axes that device currently has.

Available since: 3.0

gdk_device_list_slave_devices

If the device if of type GDK_DEVICE_TYPE_MASTER, it will return the list of slave devices attached to it, otherwise it will return NULL.

gdk_device_set_axis_use

Specifies how an axis of a device is used.

gdk_device_set_key

Specifies the X key event to generate when a macro button of a device is pressed.

gdk_device_set_mode

Sets a the mode of an input device. The mode controls if the device is active and whether the device’s range is mapped to the entire screen or to a single window.

gdk_device_ungrab

Release any grab on device.

Available since: 3.0

Deprecated since: 3.20.

gdk_device_warp

Warps device in display to the point x,y on the screen screen, unless the device is confined to a window by a grab, in which case it will be moved as far as allowed by the grab. Warping the pointer creates events as if the user had moved the mouse instantaneously to the destination.

Available since: 3.0

Methods inherited from GObject (42)

Properties

Gdk.Device:associated-device

Associated pointer or keyboard with this device, if any. Devices of type #GDK_DEVICE_TYPE_MASTER always come in keyboard/pointer pairs. Other device types will have a NULL associated device.

Available since: 3.0

Gdk.Device:axes

The axes currently available for this device.

Available since: 3.22

Gdk.Device:device-manager

The GdkDeviceManager the GdkDevice pertains to.

Available since: 3.0

Gdk.Device:display

The GdkDisplay the GdkDevice pertains to.

Available since: 3.0

Gdk.Device:has-cursor

Whether the device is represented by a cursor on the screen. Devices of type GDK_DEVICE_TYPE_MASTER will have TRUE here.

Available since: 3.0

Gdk.Device:input-mode
No description available.
Gdk.Device:input-source

Source type for the device.

Available since: 3.0

Gdk.Device:n-axes

Number of axes in the device.

Available since: 3.0

Gdk.Device:name

The device name.

Available since: 3.0

Gdk.Device:num-touches

The maximal number of concurrent touches on a touch device. Will be 0 if the device is not a touch device or if the number of touches is unknown.

Available since: 3.20

Gdk.Device:product-id

Product ID of this device, see gdk_device_get_product_id().

Available since: 3.16

Gdk.Device:seat

GdkSeat of this device.

Available since: 3.20

Gdk.Device:tool
No description available.
Gdk.Device:type

Device role in the device manager.

Available since: 3.0

Gdk.Device:vendor-id

Vendor ID of this device, see gdk_device_get_vendor_id().

Available since: 3.16

Signals

Gdk.Device::changed

The ::changed signal is emitted either when the GdkDevice has changed the number of either axes or keys. For example In X this will normally happen when the slave device routing events through the master device changes (for example, user switches from the USB mouse to a tablet), in that case the master device will change to reflect the new slave device axes and keys.

Gdk.Device::tool-changed

The ::tool-changed signal is emitted on pen/eraser GdkDevices whenever tools enter or leave proximity.

Available since: 3.22

Signals inherited from GObject (1)