---
name: "giiQueryDeviceInfo"
section: "3gii"
platform: "linux"
package: "libgii0-dev"
version: "1:0.8.1-1"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/giiQueryDeviceInfo/3gii"
---

# giiQueryDeviceInfo(3gii)

get information about a given GII input source

## NAME

giiQueryDeviceInfo, giiQueryDeviceInfoByNumber - get information about a given GII input source

## SYNOPSIS

**#include \<ggi/gii.h\>**

**int giiQueryDeviceInfo(gii\_input\_t\****inp***, uint32** *origin***,** **gii\_cmddata\_getdevinfo \****info***));**

**int giiQueryDeviceInfoByNumber(gii\_input\_t\****inp***, uint32** *number***,** **uint32 \*,** **gii\_cmddata\_getdevinfo \****info***);** .SH "DESCRIPTION"

Though when using GII inputs the exact type of device is fully  transparent to the program, information about the device that is actually attached to a given gii input and origin id can be queried, e.g. for configuration interfaces.

For **giiQueryDeviceInfo** the parameters *inp* and *origin* select the  input to query. This version is usually used, if you want to identify a device after getting an event from it.

For **giiQueryDeviceInfoByNumber** the parameters *inp* and *number* select the input to query - *origin* gets set to the origin ID the queried device has. This version is used, when you want to  query all known devices.

The queried data is put into *info*, which has the following fields:

- *longname*

  Name of the device (string, 74+\\0 chars max)

- *shortname*

  Abbreviated devicename (string, 4+\\0 chars max) gii\_event\_mask

- **gii\_event\_mask** *can\_generate*

  Events this device can generate

- *num\_buttons*

  Number of keys/buttons this device has

- *num\_axes*

  Number of valuator axes the device has

## RETURN VALUE

Returns 0 on success (info is valid, then) or -1 otherwise.

## SEE ALSO

\[XRef to GIIQUERYVALINFO\]
