package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gdk/Ocgtk_gdk/Gdk/Wrappers/Device/index.html
Module Wrappers.Device
type t = [ `device | `object_ ] Gobject.objval has_bidi_layouts : t -> boolDetermines 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 optionReturns 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;
```
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 * floatObtains 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.inputsourceDetermines the type of the device.
val get_seat : t -> [ `seat | `object_ ] Gobject.objReturns the `GdkSeat` the device belongs to.
val get_scroll_lock_state : t -> boolRetrieves whether the Scroll Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
val get_product_id : t -> string optionReturns 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 -> intRetrieves the number of touch points associated to @device.
val get_num_lock_state : t -> boolRetrieves whether the Num Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
val get_name : t -> stringThe name of the device, suitable for showing in a user interface.
val get_modifier_state : t -> Gdk_enums.modifiertypeRetrieves the current modifier state of the keyboard.
This is only relevant for keyboard devices.
val get_has_cursor : t -> boolDetermines 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.objReturns the `GdkDisplay` to which @device pertains.
val get_direction : t -> Ocgtk_pango.Pango.directionReturns 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 optionRetrieves the current tool for @device.
val get_caps_lock_state : t -> boolRetrieves whether the Caps Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
val get_n_axes : t -> intGet property: n-axes
val get_tool : t -> [ `device_tool | `object_ ] Gobject.objGet property: tool
val on_changed :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_idval on_tool_changed :
?after:bool ->
t ->
callback:(tool:[ `device_tool | `object_ ] Gobject.obj -> unit) ->
Gobject.Signal.handler_id