root/trunk/VBoxVentriloControl/findkey.c

Revision 107, 435 bytes (checked in by kfitzgerald, 3 years ago)

Added source for VBoxVentriloControl for using ventrilo inside a virtualbox virtual machine

Line 
1#include <linux/input.h>
2#include <sys/types.h>
3#include <sys/stat.h>
4#include <fcntl.h>
5#include <stdio.h>
6#include <unistd.h>
7
8int main(int argc, char **argv)
9{
10        int fd;
11        if(argc < 2) {
12                printf("usage: %s <device>\n", argv[0]);
13                return 1;
14        }
15        fd = open(argv[1], O_RDONLY);
16        struct input_event ev;
17
18        while (1)
19        {
20        read(fd, &ev, sizeof(struct input_event));
21
22        if(ev.type == 1)
23                printf("key %i state %i\n", ev.code, ev.value);
24
25        }
26}
Note: See TracBrowser for help on using the browser.