1 #include <lunaix/fctrl.h>
2 #include <lunaix/foptions.h>
3 #include <lunaix/input.h>
4 #include <lunaix/lunistd.h>
5 #include <lunaix/proc.h>
6 #include <ulibc/stdio.h>
14 int fd = open("/dev/input/i8042-kbd", 0);
17 printf("fail to open (%d)", geterrno());
21 struct input_evt_pkt event;
23 while (read(fd, &event, sizeof(event)) > 0) {
25 if (event.pkt_type == PKT_PRESS) {
31 printf("%u: %s '%c', class=0x%x, scan=%x\n",
34 event.sys_code & 0xff,
35 (event.sys_code & 0xff00) >> 8,