package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Device

type t = [ `device | `object_ ] Gobject.obj
val has_bidi_layouts : t -> bool

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

This is only relevant for keyboard devices.

val get_vendor_id : t -> string option

Returns the vendor ID of this device.

This ID is retrieved from the device, and does not change.

This function, together with method@Gdk.Device.get_product_id, can be used to eg. compose `GSettings` paths to store settings for this device.

```c static GSettings * get_device_settings (GdkDevice *device) const char *vendor, *product; GSettings *settings; GdkDevice *device; char *path; vendor = gdk_device_get_vendor_id (device); product = gdk_device_get_product_id (device); path = g_strdup_printf ("/org/example/app/devices/%s:%s/", vendor, product); settings = g_settings_new_with_path (DEVICE_SCHEMA, path); g_free (path); return settings; ```

val get_timestamp : t -> UInt32.t

Returns the timestamp of the last activity for this device.

In practice, this means the timestamp of the last event that was received from the OS for this device. (GTK may occasionally produce events for a device that are not received from the OS, and will not update the timestamp).

val get_surface_at_position : t -> [ `surface | `object_ ] Gobject.obj option * float * float

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

Returns %NULL if the surface tree under @device is not known to GDK (for example, belongs to another application).

val get_source : t -> Gdk_enums.inputsource

Determines the type of the device.

val get_seat : t -> [ `seat | `object_ ] Gobject.obj

Returns the `GdkSeat` the device belongs to.

val get_scroll_lock_state : t -> bool

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

This is only relevant for keyboard devices.

val get_product_id : t -> string option

Returns the product ID of this device.

This ID is retrieved from the device, and does not change. See method@Gdk.Device.get_vendor_id for more information.

val get_num_touches : t -> int

Retrieves the number of touch points associated to @device.

val get_num_lock_state : t -> bool

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

This is only relevant for keyboard devices.

val get_name : t -> string

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

val get_modifier_state : t -> Gdk_enums.modifiertype

Retrieves the current modifier state of the keyboard.

This is only relevant for keyboard devices.

val get_has_cursor : t -> bool

Determines whether the pointer follows device motion.

This is not meaningful for keyboard devices, which don't have a pointer.

val get_display : t -> [ `display | `object_ ] Gobject.obj

Returns the `GdkDisplay` to which @device pertains.

val get_direction : t -> Ocgtk_pango.Pango.direction

Returns the direction of effective layout of the keyboard.

This is only relevant for keyboard devices.

The direction of a layout is the direction of the majority of its symbols. See func@Pango.unichar_direction.

val get_device_tool : t -> [ `device_tool | `object_ ] Gobject.obj option

Retrieves the current tool for @device.

val get_caps_lock_state : t -> bool

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

This is only relevant for keyboard devices.

val get_n_axes : t -> int

Get property: n-axes

val get_tool : t -> [ `device_tool | `object_ ] Gobject.obj

Get property: tool

val on_changed : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id
val on_tool_changed : ?after:bool -> t -> callback:(tool:[ `device_tool | `object_ ] Gobject.obj -> unit) -> Gobject.Signal.handler_id