Input Devices

Input Devices — Object that represents individual input devices

Functions

Properties

Types and Values

Object Hierarchy

    GObject
    ╰── GrxDevice

Includes

#include <grx-3.0.h>

Description

GrxDevice is an abstract class the represents an input device such as a keyboard, mouse or touchscreen. Devices are normally handled internally in the library. So, this class is normally not used unless you need to differentiate between input events between individual devices (e.g. a a calibration program where you only want input from the device you are calibrating).

Functions

grx_device_get_name ()

const gchar *
grx_device_get_name (GrxDevice *device);

Gets the “name” of the device.

Parameters

device

the device

 

Returns

the name or NULL.

[transfer full][nullable]


grx_device_get_sysname ()

const gchar *
grx_device_get_sysname (GrxDevice *device);

Gets the “sysname” of the device.

Parameters

device

the device

 

Returns

the name or NULL.

[transfer full][nullable]


grx_device_get_has_keyboard ()

gboolean
grx_device_get_has_keyboard (GrxDevice *device);

Gets if the device has keyboard capabilities.

Parameters

device

the device

 

Returns

TRUE if the device can generate key events, otherwise FALSE.


grx_device_get_has_pointer ()

gboolean
grx_device_get_has_pointer (GrxDevice *device);

Gets if the device has mouse capabilities.

Parameters

device

the device

 

Returns

TRUE if the device can generate button/motion events, otherwise FALSE.


grx_device_get_has_touch ()

gboolean
grx_device_get_has_touch (GrxDevice *device);

Gets if the device has touch capabilities.

Parameters

device

the device

 

Returns

TRUE if the device can generate touch events, otherwise FALSE.


grx_device_reset_calibration ()

gboolean
grx_device_reset_calibration (GrxDevice *device);

Resets the calibration of the device.

This function is probably only useful to programs that are calibrating the device and need to remove the existing calibration.

[virtual reset_calibration]

Parameters

device

the device

 

Returns

TRUE if this device can be calibrated and reseting the calibration was successful, otherwise FALSE.

Types and Values

GRX_TYPE_DEVICE

#define GRX_TYPE_DEVICE grx_device_get_type()

struct GrxDeviceClass

struct GrxDeviceClass {
    GObjectClass parent_class;
    gboolean (*reset_calibration) (GrxDevice *device);
    gpointer reserved[6];
};

The type class struct for GrxDevice.

Members

reset_calibration ()

Overriding classes should implement this method if possible. The default implementation simply returns FALSE.

 

gpointer reserved[6];

for future use

 

GrxDevice

typedef struct _GrxDevice GrxDevice;

Base class for objects that represents in input device.

Property Details

The “has-keyboard” property

  “has-keyboard”             gboolean

Indicates that a device can produce key events.

Flags: Read

Default value: FALSE


The “has-pointer” property

  “has-pointer”              gboolean

Indicates that a device can produce button/motion events.

Flags: Read

Default value: FALSE


The “has-touch” property

  “has-touch”                gboolean

Indicates that a device can produce touch events.

Flags: Read

Default value: FALSE


The “name” property

  “name”                     gchar *

A descriptive name of the device, suitable for displaying to the user.

Flags: Read

Default value: NULL


The “sysname” property

  “sysname”                  gchar *

The sysfs name of the device.

Flags: Read

Default value: NULL