CdkDevice

CdkDevice — Object representing an input device

Functions

Properties

CdkDevice * associated-device Read
CdkAxisFlags axes Read
CdkDeviceManager * device-manager Read / Write / Construct Only
CdkDisplay * display Read / Write / Construct Only
gboolean has-cursor Read / Write / Construct Only
CdkInputMode input-mode Read / Write
CdkInputSource input-source Read / Write / Construct Only
guint n-axes Read
char * name Read / Write / Construct Only
guint num-touches Read / Write / Construct Only
char * product-id Read / Write / Construct Only
CdkSeat * seat Read / Write
CdkDeviceTool * tool Read
CdkDeviceType type Read / Write / Construct Only
char * vendor-id Read / Write / Construct Only

Signals

void changed Run Last
void tool-changed Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── CdkDevice

Known Derived Interfaces

CdkDevice is required by CdkDevicePad.

Includes

#include <cdk/cdk.h>

Description

The CdkDevice object represents a single input device, such as a keyboard, a mouse, a touchpad, etc.

See the CdkDeviceManager documentation for more information about the various kinds of master and slave devices, and their relationships.

Functions

cdk_device_get_name ()

const gchar *
cdk_device_get_name (CdkDevice *device);

Determines the name of the device.

Parameters

device

a CdkDevice

 

Returns

a name

Since: 2.20


cdk_device_get_vendor_id ()

const gchar *
cdk_device_get_vendor_id (CdkDevice *device);

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.

This function, together with cdk_device_get_product_id(), can be used to eg. compose GSettings paths to store settings for this device.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
static GSettings *
get_device_settings (CdkDevice *device)
{
  const gchar *vendor, *product;
  GSettings *settings;
  CdkDevice *device;
  gchar *path;

  vendor = cdk_device_get_vendor_id (device);
  product = cdk_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;
}

Parameters

device

a slave CdkDevice

 

Returns

the vendor ID, or NULL.

[nullable]

Since: 3.16


cdk_device_get_product_id ()

const gchar *
cdk_device_get_product_id (CdkDevice *device);

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 cdk_device_get_vendor_id() for more information.

Parameters

device

a slave CdkDevice

 

Returns

the product ID, or NULL.

[nullable]

Since: 3.16


cdk_device_get_source ()

CdkInputSource
cdk_device_get_source (CdkDevice *device);

Determines the type of the device.

Parameters

device

a CdkDevice

 

Returns

a CdkInputSource

Since: 2.20


cdk_device_set_mode ()

gboolean
cdk_device_set_mode (CdkDevice *device,
                     CdkInputMode 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.

Note: This is only meaningful for floating devices, master devices (and slaves connected to these) drive the pointer cursor, which is not limited by the input mode.

Parameters

device

a CdkDevice.

 

mode

the input mode.

 

Returns

TRUE if the mode was successfully changed.


cdk_device_get_mode ()

CdkInputMode
cdk_device_get_mode (CdkDevice *device);

Determines the mode of the device.

Parameters

device

a CdkDevice

 

Returns

a CdkInputSource

Since: 2.20


cdk_device_set_key ()

void
cdk_device_set_key (CdkDevice *device,
                    guint index_,
                    guint keyval,
                    CdkModifierType modifiers);

Specifies the X key event to generate when a macro button of a device is pressed.

Parameters

device

a CdkDevice

 

index_

the index of the macro button to set

 

keyval

the keyval to generate

 

modifiers

the modifiers to set

 

cdk_device_get_key ()

gboolean
cdk_device_get_key (CdkDevice *device,
                    guint index_,
                    guint *keyval,
                    CdkModifierType *modifiers);

If index_ has a valid keyval, this function will return TRUE and fill in keyval and modifiers with the keyval settings.

Parameters

device

a CdkDevice.

 

index_

the index of the macro button to get.

 

keyval

return value for the keyval.

[out]

modifiers

return value for modifiers.

[out]

Returns

TRUE if keyval is set for index .

Since: 2.20


cdk_device_set_axis_use ()

void
cdk_device_set_axis_use (CdkDevice *device,
                         guint index_,
                         CdkAxisUse use);

Specifies how an axis of a device is used.

Parameters

device

a pointer CdkDevice

 

index_

the index of the axis

 

use

specifies how the axis is used

 

cdk_device_get_axis_use ()

CdkAxisUse
cdk_device_get_axis_use (CdkDevice *device,
                         guint index_);

Returns the axis use for index_ .

Parameters

device

a pointer CdkDevice.

 

index_

the index of the axis.

 

Returns

a CdkAxisUse specifying how the axis is used.

Since: 2.20


cdk_device_get_associated_device ()

CdkDevice *
cdk_device_get_associated_device (CdkDevice *device);

Returns the associated device to device , if device is of type CDK_DEVICE_TYPE_MASTER, it will return the paired pointer or keyboard.

If device is of type CDK_DEVICE_TYPE_SLAVE, it will return the master device to which device is attached to.

If device is of type CDK_DEVICE_TYPE_FLOATING, NULL will be returned, as there is no associated device.

Parameters

device

a CdkDevice

 

Returns

The associated device, or NULL.

[nullable][transfer none]

Since: 3.0


cdk_device_list_slave_devices ()

GList *
cdk_device_list_slave_devices (CdkDevice *device);

If the device if of type CDK_DEVICE_TYPE_MASTER, it will return the list of slave devices attached to it, otherwise it will return NULL

Parameters

device

a CdkDevice

 

Returns

the list of slave devices, or NULL. The list must be freed with g_list_free(), the contents of the list are owned by CTK+ and should not be freed.

[nullable][transfer container][element-type CdkDevice]


cdk_device_get_device_type ()

CdkDeviceType
cdk_device_get_device_type (CdkDevice *device);

Returns the device type for device .

Parameters

device

a CdkDevice

 

Returns

the CdkDeviceType for device .

Since: 3.0


cdk_device_get_display ()

CdkDisplay *
cdk_device_get_display (CdkDevice *device);

Returns the CdkDisplay to which device pertains.

Parameters

device

a CdkDevice

 

Returns

a CdkDisplay. This memory is owned by CTK+, and must not be freed or unreffed.

[transfer none]

Since: 3.0


cdk_device_get_has_cursor ()

gboolean
cdk_device_get_has_cursor (CdkDevice *device);

Determines whether the pointer follows device motion. This is not meaningful for keyboard devices, which don't have a pointer.

Parameters

device

a CdkDevice

 

Returns

TRUE if the pointer follows device motion

Since: 2.20


cdk_device_get_n_axes ()

gint
cdk_device_get_n_axes (CdkDevice *device);

Returns the number of axes the device currently has.

Parameters

device

a pointer CdkDevice

 

Returns

the number of axes.

Since: 3.0


cdk_device_get_n_keys ()

gint
cdk_device_get_n_keys (CdkDevice *device);

Returns the number of keys the device currently has.

Parameters

device

a CdkDevice

 

Returns

the number of keys.

Since: 2.24


cdk_device_get_axes ()

CdkAxisFlags
cdk_device_get_axes (CdkDevice *device);

Returns the axes currently available on the device.

Parameters

device

a CdkDevice

 

Since: 3.22


cdk_device_warp ()

void
cdk_device_warp (CdkDevice *device,
                 CdkScreen *screen,
                 gint x,
                 gint y);

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.

Note that the pointer should normally be under the control of the user. This function was added to cover some rare use cases like keyboard navigation support for the color picker in the CtkColorSelectionDialog.

Parameters

device

the device to warp.

 

screen

the screen to warp device to.

 

x

the X coordinate of the destination.

 

y

the Y coordinate of the destination.

 

Since: 3.0


cdk_device_get_seat ()

CdkSeat *
cdk_device_get_seat (CdkDevice *device);

Returns the CdkSeat the device belongs to.

Parameters

device

A CdkDevice

 

Returns

A CdkSeat. This memory is owned by CTK+ and must not be freed.

[transfer none]

Since: 3.20


cdk_device_grab ()

CdkGrabStatus
cdk_device_grab (CdkDevice *device,
                 CdkWindow *window,
                 CdkGrabOwnership grab_ownership,
                 gboolean owner_events,
                 CdkEventMask event_mask,
                 CdkCursor *cursor,
                 guint32 time_);

cdk_device_grab has been deprecated since version 3.20. and should not be used in newly-written code.

Use cdk_seat_grab() instead.

Grabs the device so that all events coming from this device are passed to this application until the device is ungrabbed with cdk_device_ungrab(), or the window becomes unviewable. This overrides any previous grab on the device by this client.

Note that device and window need to be on the same display.

Device grabs are used for operations which need complete control over the given device events (either pointer or keyboard). For example in CTK+ this is used for Drag and Drop operations, popup menus and such.

Note that if the event mask of an X window has selected both button press and button release events, then a button press event will cause an automatic pointer grab until the button is released. X does this automatically since most applications expect to receive button press and release events in pairs. It is equivalent to a pointer grab on the window with owner_events set to TRUE.

If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the CdkEventGrabBroken events that are emitted when the grab ends unvoluntarily.

Parameters

device

a CdkDevice. To get the device you can use ctk_get_current_event_device() or cdk_event_get_device() if the grab is in reaction to an event. Also, you can use cdk_device_manager_get_client_pointer() but only in code that isn’t triggered by a CdkEvent and there aren’t other means to get a meaningful CdkDevice to operate on.

 

window

the CdkWindow which will own the grab (the grab window)

 

grab_ownership

specifies the grab ownership.

 

owner_events

if FALSE then all device events are reported with respect to window and are only reported if selected by event_mask . If TRUE then pointer events for this application are reported as normal, but pointer events outside this application are reported with respect to window and only if selected by event_mask . In either mode, unreported events are discarded.

 

event_mask

specifies the event mask, which is used in accordance with owner_events .

 

cursor

the cursor to display while the grab is active if the device is a pointer. If this is NULL then the normal cursors are used for window and its descendants, and the cursor for window is used elsewhere.

[allow-none]

time_

the timestamp of the event which led to this pointer grab. This usually comes from the CdkEvent struct, though CDK_CURRENT_TIME can be used if the time isn’t known.

 

Returns

CDK_GRAB_SUCCESS if the grab was successful.

Since: 3.0


cdk_device_ungrab ()

void
cdk_device_ungrab (CdkDevice *device,
                   guint32 time_);

cdk_device_ungrab has been deprecated since version 3.20. and should not be used in newly-written code.

Use cdk_seat_ungrab() instead.

Release any grab on device .

Parameters

device

a CdkDevice

 

time_

a timestap (e.g. CDK_CURRENT_TIME).

 

Since: 3.0


cdk_device_get_state ()

void
cdk_device_get_state (CdkDevice *device,
                      CdkWindow *window,
                      gdouble *axes,
                      CdkModifierType *mask);

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 CDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them. See cdk_device_grab().

[skip]

Parameters

device

a CdkDevice.

 

window

a CdkWindow.

 

axes

an array of doubles to store the values of the axes of device in, or NULL.

[nullable][array]

mask

location to store the modifiers, or NULL.

[optional][out]

cdk_device_get_position ()

void
cdk_device_get_position (CdkDevice *device,
                         CdkScreen **screen,
                         gint *x,
                         gint *y);

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 CDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them, see cdk_device_grab().

Parameters

device

pointer device to query status about.

 

screen

location to store the CdkScreen the device is on, or NULL.

[out][transfer none][allow-none]

x

location to store root window X coordinate of device , or NULL.

[out][allow-none]

y

location to store root window Y coordinate of device , or NULL.

[out][allow-none]

Since: 3.0


cdk_device_get_position_double ()

void
cdk_device_get_position_double (CdkDevice *device,
                                CdkScreen **screen,
                                gdouble *x,
                                gdouble *y);

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 CDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them. See cdk_device_grab().

Parameters

device

pointer device to query status about.

 

screen

location to store the CdkScreen the device is on, or NULL.

[out][transfer none][allow-none]

x

location to store root window X coordinate of device , or NULL.

[out][allow-none]

y

location to store root window Y coordinate of device , or NULL.

[out][allow-none]

Since: 3.10


cdk_device_get_window_at_position ()

CdkWindow *
cdk_device_get_window_at_position (CdkDevice *device,
                                   gint *win_x,
                                   gint *win_y);

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 CDK (for example, belongs to another application).

As a slave device coordinates are those of its master pointer, This function may not be called on devices of type CDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them, see cdk_device_grab().

Parameters

device

pointer CdkDevice to query info to.

 

win_x

return location for the X coordinate of the device location, relative to the window origin, or NULL.

[out][allow-none]

win_y

return location for the Y coordinate of the device location, relative to the window origin, or NULL.

[out][allow-none]

Returns

the CdkWindow under the device position, or NULL.

[nullable][transfer none]

Since: 3.0


cdk_device_get_window_at_position_double ()

CdkWindow *
cdk_device_get_window_at_position_double
                               (CdkDevice *device,
                                gdouble *win_x,
                                gdouble *win_y);

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 CDK (for example, belongs to another application).

As a slave device coordinates are those of its master pointer, This function may not be called on devices of type CDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them, see cdk_device_grab().

Parameters

device

pointer CdkDevice to query info to.

 

win_x

return location for the X coordinate of the device location, relative to the window origin, or NULL.

[out][allow-none]

win_y

return location for the Y coordinate of the device location, relative to the window origin, or NULL.

[out][allow-none]

Returns

the CdkWindow under the device position, or NULL.

[nullable][transfer none]

Since: 3.0


cdk_device_get_history ()

gboolean
cdk_device_get_history (CdkDevice *device,
                        CdkWindow *window,
                        guint32 start,
                        guint32 stop,
                        CdkTimeCoord ***events,
                        gint *n_events);

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.)

Note that there is also cdk_window_set_event_compression() to get more motion events delivered directly, independent of the windowing system.

[skip]

Parameters

device

a CdkDevice

 

window

the window with respect to which which the event coordinates will be reported

 

start

starting timestamp for range of events to return

 

stop

ending timestamp for the range of events to return

 

events

location to store a newly-allocated array of CdkTimeCoord, or NULL.

[array length=n_events][out][transfer full][optional]

n_events

location to store the length of events , or NULL.

[out][optional]

Returns

TRUE if the windowing system supports motion history and at least one event was found.


cdk_device_free_history ()

void
cdk_device_free_history (CdkTimeCoord **events,
                         gint n_events);

Frees an array of CdkTimeCoord that was returned by cdk_device_get_history().

[skip]

Parameters

events

an array of CdkTimeCoord.

[array length=n_events]

n_events

the length of the array.

 

cdk_device_get_axis ()

gboolean
cdk_device_get_axis (CdkDevice *device,
                     gdouble *axes,
                     CdkAxisUse use,
                     gdouble *value);

Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis use.

[skip]

Parameters

device

a CdkDevice

 

axes

pointer to an array of axes.

[array]

use

the use to look for

 

value

location to store the found value.

[out]

Returns

TRUE if the given axis use was found, otherwise FALSE


cdk_device_list_axes ()

GList *
cdk_device_list_axes (CdkDevice *device);

Returns a GList of CdkAtoms, containing the labels for the axes that device currently has.

Parameters

device

a pointer CdkDevice

 

Returns

A GList of CdkAtoms, free with g_list_free().

[transfer container][element-type CdkAtom]

Since: 3.0


cdk_device_get_axis_value ()

gboolean
cdk_device_get_axis_value (CdkDevice *device,
                           gdouble *axes,
                           CdkAtom axis_label,
                           gdouble *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 cdk_device_list_axes()

[skip]

Parameters

device

a pointer CdkDevice.

 

axes

pointer to an array of axes.

[array]

axis_label

CdkAtom with the axis label.

 

value

location to store the found value.

[out]

Returns

TRUE if the given axis use was found, otherwise FALSE.

Since: 3.0


cdk_device_get_last_event_window ()

CdkWindow *
cdk_device_get_last_event_window (CdkDevice *device);

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.

Parameters

device

a CdkDevice, with a source other than CDK_SOURCE_KEYBOARD

 

Returns

the last window the device.

[transfer none][allow-none]

Since: 3.12


cdk_device_tool_get_serial ()

guint64
cdk_device_tool_get_serial (CdkDeviceTool *tool);

Gets the serial of this tool, this value can be used to identify a physical tool (eg. a tablet pen) across program executions.

Parameters

tool

a CdkDeviceTool

 

Returns

The serial ID for this tool

Since: 3.22


cdk_device_tool_get_tool_type ()

CdkDeviceToolType
cdk_device_tool_get_tool_type (CdkDeviceTool *tool);

Gets the CdkDeviceToolType of the tool.

Parameters

tool

a CdkDeviceTool

 

Returns

The physical type for this tool. This can be used to figure out what sort of pen is being used, such as an airbrush or a pencil.

Since: 3.22

Types and Values

CdkDevice

typedef struct _CdkDevice CdkDevice;

enum CdkInputSource

An enumeration describing the type of an input device in general terms.

Members

CDK_SOURCE_MOUSE

the device is a mouse. (This will be reported for the core pointer, even if it is something else, such as a trackball.)

 

CDK_SOURCE_PEN

the device is a stylus of a graphics tablet or similar device.

 

CDK_SOURCE_ERASER

the device is an eraser. Typically, this would be the other end of a stylus on a graphics tablet.

 

CDK_SOURCE_CURSOR

the device is a graphics tablet “puck” or similar device.

 

CDK_SOURCE_KEYBOARD

the device is a keyboard.

 

CDK_SOURCE_TOUCHSCREEN

the device is a direct-input touch device, such as a touchscreen or tablet. This device type has been added in 3.4.

 

CDK_SOURCE_TOUCHPAD

the device is an indirect touch device, such as a touchpad. This device type has been added in 3.4.

 

CDK_SOURCE_TRACKPOINT

the device is a trackpoint. This device type has been added in 3.22

 

CDK_SOURCE_TABLET_PAD

the device is a "pad", a collection of buttons, rings and strips found in drawing tablets. This device type has been added in 3.22.

 

enum CdkInputMode

An enumeration that describes the mode of an input device.

Members

CDK_MODE_DISABLED

the device is disabled and will not report any events.

 

CDK_MODE_SCREEN

the device is enabled. The device’s coordinate space maps to the entire screen.

 

CDK_MODE_WINDOW

the device is enabled. The device’s coordinate space is mapped to a single window. The manner in which this window is chosen is undefined, but it will typically be the same way in which the focus window for key events is determined.

 

enum CdkAxisUse

An enumeration describing the way in which a device axis (valuator) maps onto the predefined valuator types that CTK+ understands.

Note that the X and Y axes are not really needed; pointer devices report their location via the x/y members of events regardless. Whether X and Y are present as axes depends on the CDK backend.

Members

CDK_AXIS_IGNORE

the axis is ignored.

 

CDK_AXIS_X

the axis is used as the x axis.

 

CDK_AXIS_Y

the axis is used as the y axis.

 

CDK_AXIS_PRESSURE

the axis is used for pressure information.

 

CDK_AXIS_XTILT

the axis is used for x tilt information.

 

CDK_AXIS_YTILT

the axis is used for y tilt information.

 

CDK_AXIS_WHEEL

the axis is used for wheel information.

 

CDK_AXIS_DISTANCE

the axis is used for pen/tablet distance information. (Since: 3.22)

 

CDK_AXIS_ROTATION

the axis is used for pen rotation information. (Since: 3.22)

 

CDK_AXIS_SLIDER

the axis is used for pen slider information. (Since: 3.22)

 

CDK_AXIS_LAST

a constant equal to the numerically highest axis value.

 

enum CdkAxisFlags

Flags describing the current capabilities of a device/tool.

Members

CDK_AXIS_FLAG_X

X axis is present

 

CDK_AXIS_FLAG_Y

Y axis is present

 

CDK_AXIS_FLAG_PRESSURE

Pressure axis is present

 

CDK_AXIS_FLAG_XTILT

X tilt axis is present

 

CDK_AXIS_FLAG_YTILT

Y tilt axis is present

 

CDK_AXIS_FLAG_WHEEL

Wheel axis is present

 

CDK_AXIS_FLAG_DISTANCE

Distance axis is present

 

CDK_AXIS_FLAG_ROTATION

Z-axis rotation is present

 

CDK_AXIS_FLAG_SLIDER

Slider axis is present

 

Since: 3.22


enum CdkDeviceToolType

Indicates the specific type of tool being used being a tablet. Such as an airbrush, pencil, etc.

Members

CDK_DEVICE_TOOL_TYPE_UNKNOWN

Tool is of an unknown type.

 

CDK_DEVICE_TOOL_TYPE_PEN

Tool is a standard tablet stylus.

 

CDK_DEVICE_TOOL_TYPE_ERASER

Tool is standard tablet eraser.

 

CDK_DEVICE_TOOL_TYPE_BRUSH

Tool is a brush stylus.

 

CDK_DEVICE_TOOL_TYPE_PENCIL

Tool is a pencil stylus.

 

CDK_DEVICE_TOOL_TYPE_AIRBRUSH

Tool is an airbrush stylus.

 

CDK_DEVICE_TOOL_TYPE_MOUSE

Tool is a mouse.

 

CDK_DEVICE_TOOL_TYPE_LENS

Tool is a lens cursor.

 

Since: 3.22


enum CdkDeviceType

Indicates the device type. See above for more information about the meaning of these device types.

Members

CDK_DEVICE_TYPE_MASTER

Device is a master (or virtual) device. There will be an associated focus indicator on the screen.

 

CDK_DEVICE_TYPE_SLAVE

Device is a slave (or physical) device.

 

CDK_DEVICE_TYPE_FLOATING

Device is a physical device, currently not attached to any virtual device.

 

enum CdkGrabOwnership

Defines how device grabs interact with other devices.

Members

CDK_OWNERSHIP_NONE

All other devices’ events are allowed.

 

CDK_OWNERSHIP_WINDOW

Other devices’ events are blocked for the grab window.

 

CDK_OWNERSHIP_APPLICATION

Other devices’ events are blocked for the whole application.

 

struct CdkTimeCoord

struct CdkTimeCoord {
  guint32 time;
  gdouble axes[CDK_MAX_TIMECOORD_AXES];
};

A CdkTimeCoord stores a single event in a motion history.

Members

guint32 time;

The timestamp for this event.

 

gdouble axes[CDK_MAX_TIMECOORD_AXES];

the values of the device’s axes.

 

Property Details

The “associated-device” property

  “associated-device”        CdkDevice *

Associated pointer or keyboard with this device, if any. Devices of type CDK_DEVICE_TYPE_MASTER always come in keyboard/pointer pairs. Other device types will have a NULL associated device.

Owner: CdkDevice

Flags: Read

Since: 3.0


The “axes” property

  “axes”                     CdkAxisFlags

The axes currently available for this device.

Owner: CdkDevice

Flags: Read

Since: 3.22


The “device-manager” property

  “device-manager”           CdkDeviceManager *

The CdkDeviceManager the CdkDevice pertains to.

Owner: CdkDevice

Flags: Read / Write / Construct Only

Since: 3.0


The “display” property

  “display”                  CdkDisplay *

The CdkDisplay the CdkDevice pertains to.

Owner: CdkDevice

Flags: Read / Write / Construct Only

Since: 3.0


The “has-cursor” property

  “has-cursor”               gboolean

Whether the device is represented by a cursor on the screen. Devices of type CDK_DEVICE_TYPE_MASTER will have TRUE here.

Owner: CdkDevice

Flags: Read / Write / Construct Only

Default value: FALSE

Since: 3.0


The “input-mode” property

  “input-mode”               CdkInputMode

Input mode for the device.

Owner: CdkDevice

Flags: Read / Write

Default value: CDK_MODE_DISABLED


The “input-source” property

  “input-source”             CdkInputSource

Source type for the device.

Owner: CdkDevice

Flags: Read / Write / Construct Only

Default value: CDK_SOURCE_MOUSE

Since: 3.0


The “n-axes” property

  “n-axes”                   guint

Number of axes in the device.

Owner: CdkDevice

Flags: Read

Default value: 0

Since: 3.0


The “name” property

  “name”                     char *

The device name.

Owner: CdkDevice

Flags: Read / Write / Construct Only

Default value: NULL

Since: 3.0


The “num-touches” property

  “num-touches”              guint

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.

Owner: CdkDevice

Flags: Read / Write / Construct Only

Default value: 0

Since: 3.20


The “product-id” property

  “product-id”               char *

Product ID of this device, see cdk_device_get_product_id().

Owner: CdkDevice

Flags: Read / Write / Construct Only

Default value: NULL

Since: 3.16


The “seat” property

  “seat”                     CdkSeat *

CdkSeat of this device.

Owner: CdkDevice

Flags: Read / Write

Since: 3.20


The “tool” property

  “tool”                     CdkDeviceTool *

The tool that is currently used with this device.

Owner: CdkDevice

Flags: Read


The “type” property

  “type”                     CdkDeviceType

Device role in the device manager.

Owner: CdkDevice

Flags: Read / Write / Construct Only

Default value: CDK_DEVICE_TYPE_MASTER

Since: 3.0


The “vendor-id” property

  “vendor-id”                char *

Vendor ID of this device, see cdk_device_get_vendor_id().

Owner: CdkDevice

Flags: Read / Write / Construct Only

Default value: NULL

Since: 3.16

Signal Details

The “changed” signal

void
user_function (CdkDevice *device,
               gpointer   user_data)

The ::changed signal is emitted either when the CdkDevice 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.

Parameters

device

the CdkDevice that changed.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “tool-changed” signal

void
user_function (CdkDevice     *device,
               CdkDeviceTool *tool,
               gpointer       user_data)

The ::tool-changed signal is emitted on pen/eraser CdkDevices whenever tools enter or leave proximity.

Parameters

device

the CdkDevice that changed.

 

tool

The new current tool

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.22

See Also

CdkDeviceManager