- According to Pavel Frolov the space pilot pro sends absolute events for some

reason. Applied his changes to support that device.


git-svn-id: svn+ssh://svn.code.sf.net/p/spacenav/code/trunk/spacenavd@100 ef983eb1-d774-4af8-acfd-baaf7b16a646
pull/1/head
John Tsiombikas 2010-03-05 23:18:10 +00:00
rodzic 71993bd239
commit df57ada5a0
1 zmienionych plików z 6 dodań i 7 usunięć

Wyświetl plik

@ -230,6 +230,12 @@ int read_dev(struct dev_input *inp)
inp->val = iev.value;
break;
case EV_ABS:
inp->type = INP_MOTION;
inp->idx = iev.code - ABS_X;
inp->val = iev.value;
break;
case EV_KEY:
inp->type = INP_BUTTON;
inp->idx = iev.code - BTN_0;
@ -291,13 +297,6 @@ static int open_dev(const char *path)
return -1;
}
if(!TEST_BIT(EV_REL, evtype_mask)) {
fprintf(stderr, "Wrong device, no relative events reported!\n");
close(dev_fd);
dev_fd = -1;
return -1;
}
/* try to grab the device */
if(ioctl(dev_fd, EVIOCGRAB, &grab) == -1) {
perror("failed to grab the spacenav device");