require a device name.
.PP
.TP 8
-.B --list [--short || --long] [\fIdevice\fP]
+.B --list [--short || --long || --name-only] [\fIdevice\fP]
If no argument is given list all the input devices. If an argument is given,
show all the features of \fIdevice\fP.
If --long is provided, the output includes detailed information about the
capabilities of each devices. Otherwise, or if --short is provided, only the
device names and some minimal information is listed.
+If --name-only is provided, the output is limited to the device names. One
+device name is listed per line. Note that the order the devices are listed
+is undefined.
.PP
.TP 8
.B --get-feedbacks \fIdevice\fP
enum print_format {
FORMAT_SHORT,
- FORMAT_LONG
+ FORMAT_LONG,
+ FORMAT_NAME
};
XValuatorInfoPtr v;
XAxisInfoPtr a;
+ if (format == FORMAT_NAME)
+ {
+ printf("%s\n", info->name);
+ return;
+ }
+
printf("\"%s\"\tid=%ld\t[", info->name, info->id);
switch (info->use) {
static void
print_info_xi2(Display* display, XIDeviceInfo *dev, enum print_format format)
{
+ if (format == FORMAT_NAME)
+ {
+ printf("%s\n", dev->name);
+ return;
+ }
+
printf("%-40s\tid=%d\t[", dev->name, dev->deviceid);
switch(dev->use)
{
dev = &info[i];
if (dev->use == XIMasterPointer || dev->use == XIMasterKeyboard)
{
- if (dev->use == XIMasterPointer)
- printf("⎡ ");
- else
- printf("⎣ ");
+ if (format == FORMAT_SHORT || format == FORMAT_LONG)
+ {
+ if (dev->use == XIMasterPointer)
+ printf("⎡ ");
+ else
+ printf("⎣ ");
+ }
print_info_xi2(display, dev, format);
for (j = 0; j < ndevices; j++)
if ((sd->use == XISlavePointer || sd->use == XISlaveKeyboard) &&
(sd->attachment == dev->deviceid))
{
- printf("%s ↳ ", dev->use == XIMasterPointer ? "⎜" : " ");
+ if (format == FORMAT_SHORT || format == FORMAT_LONG)
+ printf("%s ↳ ", dev->use == XIMasterPointer ? "⎜" : " ");
print_info_xi2(display, sd, format);
}
}
format = FORMAT_SHORT;
else if (strcmp(argv[0], "--long") == 0)
format = FORMAT_LONG;
+ else if (strcmp(argv[0], "--name-only") == 0)
+ format = FORMAT_NAME;
arg_dev++;
}