dmi_pointing_device

Synopsis

#include <opendmi/entity/pointing-device.h>

typedef struct dmi_pointing_device {
    dmi_pointing_device_type_t type;
    dmi_pointing_device_iface_t interface;
    unsigned short button_count;
} dmi_pointing_device_t;

Description

The dmi_pointing_device_t structure holds the decoded built-in pointing device structure (type 21) of SMBIOS: the type, interface and number of buttons of the pointing device built into the system, such as the touch pad of a laptop. The structure being present does not mean that the device is in use.

The structure is returned by dmi_entity_info for the structures of type DMI_TYPE(pointing_device), and lives as long as the context it has been decoded in.

Fields

type

Type of the pointing device, see dmi_pointing_device_type.

interface

Interface the pointing device is connected through, see dmi_pointing_device_iface.

button_count

Number of buttons of the pointing device, for example 3 for a three-button mouse.

Examples

dmi_registry_t        *registry = dmi_get_registry(context);
dmi_entity_t          *entity   = dmi_registry_lookup_first(registry,
                                      DMI_TYPE(pointing_device), false);
dmi_pointing_device_t *device   = dmi_entity_info(entity,
                                      DMI_TYPE(pointing_device));

if (device != nullptr)
    printf("%s (%s), %u buttons\n",
           dmi_pointing_device_type_name(device->type),
           dmi_pointing_device_iface_name(device->interface),
           device->button_count);

Standards

DMTF SMBIOS Specification (DSP0134), version 2.1 or newer.