initial version
This commit is contained in:
commit
6cdb039c6c
9 changed files with 556 additions and 0 deletions
35
twsmux.c
Normal file
35
twsmux.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include <sys/time.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <dev/wscons/wsconsio.h>
|
||||
#include <dev/wscons/wsdisplay_usl_io.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
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);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue