Class
GdkDevice
Description [src]
abstract class Gdk.Device : GObject.Object
{
/* No available fields */
}
The GdkDevice
object represents a single input device, such
as a keyboard, a mouse, a touchpad, etc.
See the GdkDeviceManager
documentation for more information
about the various kinds of master and slave devices, and their relationships.
Functions
gdk_device_free_history
Frees an array of GdkTimeCoord
that was returned by gdk_device_get_history().
gdk_device_grab_info_libgtk_only
Determines information about the current keyboard grab. This is not public API and must not be used by applications.
deprecated: 3.16
Instance methods
gdk_device_get_associated_device
Returns the associated device to device
, if device
is of type
GDK_DEVICE_TYPE_MASTER
, it will return the paired pointer or keyboard.
since: 3.0
gdk_device_get_axis
Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis use.
gdk_device_get_axis_value
Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis label, as returned by gdk_device_list_axes().
since: 3.0
gdk_device_get_has_cursor
Determines whether the pointer follows device motion. This is not meaningful for keyboard devices, which don’t have a pointer.
since: 2.20
gdk_device_get_history
Obtains the motion history for a pointer device; given a starting and
ending timestamp, return all events in the motion history for
the device in the given range of time. Some windowing systems
do not support motion history, in which case, FALSE
will
be returned. (This is not distinguishable from the case where
motion history is supported and no events were found.).
gdk_device_get_key
If index_
has a valid keyval, this function will return TRUE
and fill in keyval
and modifiers
with the keyval settings.
since: 2.20
gdk_device_get_last_event_window
Gets information about which window the given pointer device is in, based on events
that have been received so far from the display server. If another application
has a pointer grab, or this application has a grab with owner_events = FALSE
,
NULL
may be returned even if the pointer is physically over one of this
application’s windows.
since: 3.12
gdk_device_get_position
Gets the current location of device
. As a slave device
coordinates are those of its master pointer, This function
may not be called on devices of type GDK_DEVICE_TYPE_SLAVE
,
unless there is an ongoing grab on them, see gdk_device_grab().
since: 3.0
gdk_device_get_position_double
Gets the current location of device
in double precision. As a slave device’s
coordinates are those of its master pointer, this function
may not be called on devices of type GDK_DEVICE_TYPE_SLAVE
,
unless there is an ongoing grab on them. See gdk_device_grab().
since: 3.10
gdk_device_get_product_id
Returns the product ID of this device, or NULL
if this information couldn’t
be obtained. This ID is retrieved from the device, and is thus constant for
it. See gdk_device_get_vendor_id()
for more information.
since: 3.16
gdk_device_get_state
Gets the current state of a pointer device relative to window
. As a slave
device’s coordinates are those of its master pointer, this
function may not be called on devices of type GDK_DEVICE_TYPE_SLAVE
,
unless there is an ongoing grab on them. See gdk_device_grab().
gdk_device_get_vendor_id
Returns the vendor ID of this device, or NULL
if this information couldn’t
be obtained. This ID is retrieved from the device, and is thus constant for it.
since: 3.16
gdk_device_get_window_at_position
Obtains the window underneath device
, returning the location of the device in win_x
and win_y
. Returns
NULL
if the window tree under device
is not known to GDK (for example, belongs to another application).
since: 3.0
gdk_device_get_window_at_position_double
Obtains the window underneath device
, returning the location of the device in win_x
and win_y
in
double precision. Returns NULL
if the window tree under device
is not known to GDK (for example,
belongs to another application).
since: 3.0
gdk_device_grab
Grabs the device so that all events coming from this device are passed to this application until the device is ungrabbed with gdk_device_ungrab(), or the window becomes unviewable. This overrides any previous grab on the device by this client.
deprecated: 3.20. since: 3.0
gdk_device_list_axes
Returns a GList
of GdkAtoms
, containing the labels for
the axes that device
currently has.
since: 3.0
gdk_device_list_slave_devices
If the device if of type GDK_DEVICE_TYPE_MASTER
, it will return
the list of slave devices attached to it, otherwise it will return
NULL
.
gdk_device_set_key
Specifies the X key event to generate when a macro button of a device is pressed.
gdk_device_set_mode
Sets a the mode of an input device. The mode controls if the device is active and whether the device’s range is mapped to the entire screen or to a single window.
gdk_device_warp
Warps device
in display
to the point x
,y
on
the screen screen
, unless the device is confined
to a window by a grab, in which case it will be moved
as far as allowed by the grab. Warping the pointer
creates events as if the user had moved the mouse
instantaneously to the destination.
since: 3.0
Properties
Gdk.Device:associated-device
Associated pointer or keyboard with this device, if any. Devices of type #GDK_DEVICE_TYPE_MASTER
always come in keyboard/pointer pairs. Other device types will have a NULL
associated device.
since: 3.0
Gdk.Device:has-cursor
Whether the device is represented by a cursor on the screen. Devices of type
GDK_DEVICE_TYPE_MASTER
will have TRUE
here.
since: 3.0
Gdk.Device:num-touches
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.
since: 3.20
Signals
Gdk.Device::changed
The ::changed signal is emitted either when the GdkDevice
has changed the number of either axes or keys. For example
In X this will normally happen when the slave device routing
events through the master device changes (for example, user
switches from the USB mouse to a tablet), in that case the
master device will change to reflect the new slave device
axes and keys.
Gdk.Device::tool-changed
The ::tool-changed signal is emitted on pen/eraser
GdkDevices
whenever tools enter or leave proximity.
since: 3.22
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.