kopia lustrzana https://github.com/FreeSpacenav/spacenavd
				
				
				
			- 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-baaf7b16a646pull/1/head
							rodzic
							
								
									71993bd239
								
							
						
					
					
						commit
						df57ada5a0
					
				| 
						 | 
				
			
			@ -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");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue