1 #include <lunaix/fctrl.h>
2 #include <lunaix/foptions.h>
3 #include <lunaix/input.h>
4 #include <lunaix/lunistd.h>
5 #include <ulibc/stdio.h>
13 int fd = open("/dev/input/i8042-kbd", 0);
16 printf("fail to open (%d)", fd);
20 struct input_evt_pkt event;
22 while (read(fd, &event, sizeof(event)) > 0) {
24 if (event.pkt_type == PKT_PRESS) {
30 printf("%u: %s '%c', class=0x%x, scan=%d\n",
33 event.sys_code & 0xff,
34 (event.sys_code & 0xff00) >> 8,