Device
Object Hierarchy:
Description:
The `GdkDevice` object represents an input device, such as a keyboard, a mouse, or a touchpad.
See the [class@Gdk.Seat] documentation for more information about the various kinds of devices, and their relationships.
Required by:
Namespace: Gdk
Package: gtk4
Content:
Properties:
- public bool caps_lock_state { get; }
Whether Caps Lock is on.
- public Direction direction { get; }
The direction of the current layout.
- public Display display { get; construct; }
The `GdkDisplay` the `GdkDevice` pertains to.
- public bool has_bidi_layouts { get; }
Whether the device has both right-to-left and left-to-right layouts.
- public bool has_cursor { get; construct; }
Whether the device is represented by a cursor on the screen.
- public ModifierType modifier_state { get; }
The current modifier state of the device.
- public uint n_axes { get; }
Number of axes in the device.
- public string? name { get; construct; }
The device name.
- public bool num_lock_state { get; }
Whether Num Lock is on.
- public uint num_touches { get; construct; }
The maximal number of concurrent touches on a touch device.
- public string product_id { get; construct; }
Product ID of this device.
- public bool scroll_lock_state { get; }
Whether Scroll Lock is on.
- public Seat seat { owned get; set; }
`GdkSeat` of this device.
- public InputSource source { get; construct; }
Source type for the device.
- public DeviceTool tool { owned get; }
The `GdkDeviceTool` that is currently used with this device.
- public string vendor_id { get; construct; }
Vendor ID of this device.
Creation methods:
- protected Device ()
Methods:
- public bool get_caps_lock_state ()
Retrieves whether the Caps Lock modifier of the keyboard is locked.
- public unowned DeviceTool? get_device_tool ()
Retrieves the current tool for this.
- public Direction get_direction ()
Returns the direction of effective layout of the keyboard.
- public unowned Display get_display ()
Returns the `GdkDisplay` to which this pertains.
- public bool get_has_cursor ()
Determines whether the pointer follows device motion.
- public ModifierType get_modifier_state ()
Retrieves the current modifier state of the keyboard.
- public unowned string get_name ()
The name of the device, suitable for showing in a user interface.
- public bool get_num_lock_state ()
Retrieves whether the Num Lock modifier of the keyboard is locked.
- public uint get_num_touches ()
Retrieves the number of touch points associated to this.
- public unowned string? get_product_id ()
Returns the product ID of this device.
- public bool get_scroll_lock_state ()
Retrieves whether the Scroll Lock modifier of the keyboard is locked.
- public unowned Seat get_seat ()
Returns the `GdkSeat` the device belongs to.
- public InputSource get_source ()
Determines the type of the device.
- public unowned Surface? get_surface_at_position (out double win_x, out double win_y)
Obtains the surface underneath this, returning the location of the device in
win_x
andwin_y
. - public uint32 get_timestamp ()
Returns the timestamp of the last activity for this device.
- public unowned string? get_vendor_id ()
Returns the vendor ID of this device.
Signals:
- public signal void changed ()
Emitted either when the number of either axes or keys changes.
- public signal void tool_changed (DeviceTool tool)
Emitted on pen/eraser devices whenever tools enter or leave proximity.
Inherited Members:
All known members inherited from class GLib.Object