Gdk.Device
Description: Reference for Gdk.Device

### Class

# GdkDevice

#### Description [src]

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

The `GdkDevice` object represents an input device, such as a keyboard, a mouse, or a touchpad.

See the `GdkSeat` documentation for more information about the various kinds of devices, and their relationships.

#### Hierarchy

#### Ancestors

- GObject

#### Instance methods

###### gdk_device_get_caps_lock_state

Retrieves whether the Caps Lock modifier of the keyboard is locked.

###### gdk_device_get_device_tool

Retrieves the current tool for `device`.

###### gdk_device_get_direction

Returns the direction of effective layout of the keyboard.

###### gdk_device_get_display

Returns the `GdkDisplay` to which `device` pertains.

###### gdk_device_get_has_cursor

Determines whether the pointer follows device motion.

###### gdk_device_get_modifier_state

Retrieves the current modifier state of the keyboard.

###### gdk_device_get_name

The name of the device, suitable for showing in a user interface.

###### gdk_device_get_num_lock_state

Retrieves whether the Num Lock modifier of the keyboard is locked.

###### gdk_device_get_num_touches

Retrieves the number of touch points associated to `device`.

###### gdk_device_get_product_id

Returns the product ID of this device.

###### gdk_device_get_scroll_lock_state

Retrieves whether the Scroll Lock modifier of the keyboard is locked.

###### gdk_device_get_seat

Returns the `GdkSeat` the device belongs to.

###### gdk_device_get_source

Determines the type of the device.

###### gdk_device_get_surface_at_position

Obtains the surface underneath `device`, returning the location of the device in `win_x` and `win_y`.

###### gdk_device_get_timestamp

Returns the timestamp of the last activity for this device.

since: 4.2

###### gdk_device_get_vendor_id

Returns the vendor ID of this device.

###### gdk_device_has_bidi_layouts

Determines if layouts for both right-to-left and left-to-right languages are in use on the keyboard.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gdk.Device:caps-lock-state

Whether Caps Lock is on.

###### Gdk.Device:direction

The direction of the current layout.

###### Gdk.Device:display

The `GdkDisplay` the `GdkDevice` pertains to.

###### Gdk.Device:has-bidi-layouts

Whether the device has both right-to-left and left-to-right layouts.

###### Gdk.Device:has-cursor

Whether the device is represented by a cursor on the screen.

###### Gdk.Device:modifier-state

The current modifier state of the device.

###### Gdk.Device:n-axes

Number of axes in the device.

###### Gdk.Device:name

The device name.

###### Gdk.Device:num-lock-state

Whether Num Lock is on.

###### Gdk.Device:num-touches

The maximal number of concurrent touches on a touch device.

###### Gdk.Device:product-id

Product ID of this device.

###### Gdk.Device:scroll-lock-state

Whether Scroll Lock is on.

###### Gdk.Device:seat

`GdkSeat` of this device.

###### Gdk.Device:source

Source type for the device.

###### Gdk.Device:tool

The `GdkDeviceTool` that is currently used with this device.

###### Gdk.Device:vendor-id

Vendor ID of this device.

#### Signals

###### Gdk.Device::changed

Emitted either when the number of either axes or keys changes.

###### Gdk.Device::tool-changed

Emitted on pen/eraser devices whenever tools enter or leave proximity.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.