#include #include #include #include #include #include int main(int argc, char **argv) { int fd, i; struct wsmux_device_list devs; if ((fd = open(argv[1] != NULL ? argv[1]:"/dev/wskbd", O_RDONLY)) < 0) { perror("open"); return 1; } if (ioctl(fd, WSMUXIO_LIST_DEVICES, &devs) < 0) { perror("LIST_DEVICES"); return 1; } printf("devices: %d\n", devs.ndevices); for (i = 0; i < devs.ndevices; i++) { printf("device %d type %d idx %d\n", i, devs.devices[i].type, devs.devices[i].idx); } /* while (1) { n = read(fd, &ev, sizeof(ev)); printf("type: %d, value %d\n", ev.type, ev.value); } */ }