It derives from <GObject>.
Represents an input device, such as a keyboard, mouse or touchpad.
See the <GdkSeat> documentation for more information
about the various kinds of devices, and their relationships.
The index of the keyboard active layout of a
<GdkDevice>.
Will be -1 if there is no valid active layout.
This is only relevant for keyboard devices.
Its value is a 32-bit integer.
It is read only.
Whether Caps Lock is on.
This is only relevant for keyboard devices.
Its value is a boolean.
It is read only.
The direction of the current layout.
This is only relevant for keyboard devices.
Its value is a <PangoDirection>.
It is read only.
The <GdkDisplay> the
<GdkDevice> pertains to.
Its value is a <GdkDisplay>, or #f.
It can only be set when the object is made, with #:display.
Whether the device has both right-to-left and left-to-right layouts.
This is only relevant for keyboard devices.
Its value is a boolean.
It is read only.
Whether the device is represented by a cursor on the screen.
Its value is a boolean.
It can only be set when the object is made, with #:has-cursor.
The names of the keyboard layouts of a <GdkDevice>.
This is only relevant for keyboard devices.
Its value is a vector, each a string, or #f.
It is read only.
The current modifier state of the device.
This is only relevant for keyboard devices.
Its value is a <GdkModifierType>.
It is read only.
Number of axes in the device.
Its value is an unsigned 32-bit integer.
It is read only.
The device name.
Its value is a string, or #f.
It can only be set when the object is made, with #:name.
Whether Num Lock is on.
This is only relevant for keyboard devices.
Its value is a boolean.
It is read only.
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.
Its value is an unsigned 32-bit integer.
It can only be set when the object is made, with #:num-touches.
Product ID of this device.
Its value is a string, or #f.
It can only be set when the object is made, with #:product-id.
Whether Scroll Lock is on.
This is only relevant for keyboard devices.
Its value is a boolean.
It is read only.
<GdkSeat> of this device.
Its value is a <GdkSeat>, or #f.
Set it with (set! (device:seat self) value).
Source type for the device.
Its value is a <GdkInputSource> (or, to set
it, one of its symbols).
It can only be set when the object is made, with #:source.
The <GdkDeviceTool> that is currently used with
this device.
Its value is a <GdkDeviceTool>, or #f.
It is read only.
Vendor ID of this device.
See device:get-vendor-id.
Its value is a string, or #f.
It can only be set when the object is made, with #:vendor-id.
Retrieves the index of the active layout of the keyboard.
If there is no valid active layout for the
<GdkDevice>, this function will return -1;
This is only relevant for keyboard devices.
Passed: a <GdkDevice>.
Returned: a 32-bit integer.
The layout index of the active layout or -1.
Retrieves whether the Caps Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
Passed: a <GdkDevice>.
Returned: a boolean.
#t if Caps Lock is on for self
Retrieves the current tool for self.
Passed: a <GdkDevice>.
Returned: a <GdkDeviceTool>, or #f.
the <GdkDeviceTool>
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 unichar-direction.
Passed: a <GdkDevice>.
Returned: a <PangoDirection>.
ltr or rtl
if it can determine the direction. neutral
otherwise
Returns the <GdkDisplay> to which self
pertains.
Passed: a <GdkDevice>.
Returned: a <GdkDisplay>.
Determines whether the pointer follows device motion.
This is not meaningful for keyboard devices, which don’t have a pointer.
Passed: a <GdkDevice>.
Returned: a boolean.
#t if the pointer follows device motion
Retrieves the names of the layouts of the keyboard.
This is only relevant for keyboard devices.
Passed: a <GdkDevice>.
Returned: a vector, each a string, or #f.
#f-terminated array of strings of layouts,
Retrieves the current modifier state of the keyboard.
This is only relevant for keyboard devices.
Passed: a <GdkDevice>.
Returned: a <GdkModifierType>.
the current modifier state
The name of the device, suitable for showing in a user interface.
Passed: a <GdkDevice>.
a GdkDevice‘
Returned: a string.
a name
Retrieves whether the Num Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
Passed: a <GdkDevice>.
a “GdkDevice‘
Returned: a boolean.
#t if Num Lock is on for self
Retrieves the number of touch points associated to self.
Passed: a <GdkDevice>.
Returned: an unsigned 32-bit integer.
the number of touch points
Returns the product ID of this device.
This ID is retrieved from the device, and does not change. See
device:get-vendor-id for more
information.
Passed: a <GdkDevice>.
a physical <GdkDevice>
Returned: a string, or #f.
the product ID
Retrieves whether the Scroll Lock modifier of the keyboard is locked.
This is only relevant for keyboard devices.
Passed: a <GdkDevice>.
Returned: a boolean.
#t if Scroll Lock is on for self
Returns the <GdkSeat> the device belongs to.
Passed: a <GdkDevice>.
Returned: a <GdkSeat>.
Determines the type of the device.
Passed: a <GdkDevice>.
Returned: a <GdkInputSource>.
Obtains the surface underneath self, returning the location of the device in win-x and win-y.
Returns #f if the surface tree under self is not known to
GDK (for example, belongs to another application).
Passed: a <GdkDevice>.
pointer <GdkDevice> to query info to
Returned: a <GdkSurface>, or #f.
the <GdkSurface> under the device position
Returned: a real number.
return location for the X coordinate of the device location relative to the surface origin
Returned: a real number.
return location for the Y coordinate of the device location relative to the surface origin
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).
Passed: a <GdkDevice>.
Returned: an unsigned 32-bit integer.
the timestamp of the last activity for this device
Returns the vendor ID of this device.
This ID is retrieved from the device, and does not change.
This function, together with device:get-product-id, can be used to eg. compose
<GSettings> paths to store settings for this
device.
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;
}
Passed: a <GdkDevice>.
a physical <GdkDevice>
Returned: a string, or #f.
the vendor ID
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.
Passed: a <GdkDevice>.
Returned: a boolean.
#t if there are layouts with both directions, #f otherwise
Connect a handler with (connect object device:changed handler).
It is called as (handler self).
Emitted either when the number of either axes or keys changes.
On X11 this will normally happen when the physical device routing events through the logical device changes (for example, user switches from the USB mouse to a tablet); in that case the logical device will change to reflect the axes and keys on the new physical device.
Passed: a <GdkDevice>.
Connect a handler with (connect object device:tool-changed
handler). It is called as (handler self tool).
Emitted on pen/eraser devices whenever tools enter or leave proximity.
Passed: a <GdkDevice>.
Passed: a <GdkDeviceTool>.
The new current tool