kopia lustrzana https://github.com/FreeSpacenav/spacenavd
- Better example-spnavrc descriptions
- remove some debugging printfs which where commited accidentally previously git-svn-id: svn+ssh://svn.code.sf.net/p/spacenav/code/trunk/spacenavd@189 ef983eb1-d774-4af8-acfd-baaf7b16a646pull/1/head
rodzic
69f0a1bd65
commit
6d326b1f27
|
@ -92,23 +92,33 @@
|
|||
|
||||
|
||||
# Device grab (USB)
|
||||
#
|
||||
# When set to true (default): grab the USB device to prevent other programs
|
||||
# (such as the X server) from also using it.
|
||||
#
|
||||
# Grabbing the device ensures that other programs won't be able to use it without
|
||||
# talking to spacenavd. For instance some versions of Xorg will use the device to move
|
||||
# the mouse pointer if we don't grab it.
|
||||
# Set this to false if you want to use programs that try to talk to the device directly
|
||||
# such as google earth, then follow FAQ 11 http://spacenav.sourceforge.net/faq.html#faq11
|
||||
# to force the X server to ignore the device
|
||||
#
|
||||
#grab = true
|
||||
|
||||
|
||||
# Custom USB device
|
||||
# List of additional devices to use
|
||||
# List of additional USB devices to use (multiple devices can be listed)
|
||||
#
|
||||
# example:
|
||||
# device-id = 046d:c625
|
||||
|
||||
|
||||
# Repeat interval (milliseconds)
|
||||
# How often should spacenavd repeat the last event while out of the deadzone?
|
||||
# Non-deadzone events are repeated every so many milliseconds (-1 to disable).
|
||||
#
|
||||
# You probably don't need this setting. Set it to something like 250 if you
|
||||
# find that your apps stop moving the view while you hold the puck/ball at a
|
||||
# fixed off-center position (like bottomed out on the vertical axis).
|
||||
# Set to -1 to disable it (default).
|
||||
# Might cause inadvertent continuous motion if the deadzone is too small for
|
||||
# the re-centering power of the device.
|
||||
#
|
||||
#repeat-interval = -1
|
||||
|
|
|
@ -452,8 +452,7 @@ int write_cfg(const char *fname, struct cfg *cfg)
|
|||
fprintf(fp, "#serial = /dev/ttyS0\n");
|
||||
}
|
||||
|
||||
fprintf(fp, "# custom list USB device ids to open if present\n");
|
||||
fprintf(fp, "# (multiple entries can be listed)\n");
|
||||
fprintf(fp, "List of additional USB devices to use (multiple devices can be listed)");
|
||||
for(i=0; i<MAX_CUSTOM; i++) {
|
||||
if(cfg->devid[i][0] != -1 && cfg->devid[i][1] != -1) {
|
||||
fprintf(fp, "device-id = %x:%x\n", cfg->devid[i][0], cfg->devid[i][1]);
|
||||
|
|
|
@ -207,14 +207,14 @@ static int read_evdev(struct device *dev, struct dev_input *inp)
|
|||
inp->type = INP_MOTION;
|
||||
inp->idx = iev.code - REL_X;
|
||||
inp->val = iev.value;
|
||||
printf("[%s] EV_REL(%d): %d\n", dev->name, inp->idx, iev.value);
|
||||
/*printf("[%s] EV_REL(%d): %d\n", dev->name, inp->idx, iev.value);*/
|
||||
break;
|
||||
|
||||
case EV_ABS:
|
||||
inp->type = INP_MOTION;
|
||||
inp->idx = iev.code - ABS_X;
|
||||
inp->val = map_range(dev, inp->idx, iev.value);
|
||||
printf("[%s] EV_ABS(%d): %d (orig: %d)\n", dev->name, inp->idx, inp->val, iev.value);
|
||||
/*printf("[%s] EV_ABS(%d): %d (orig: %d)\n", dev->name, inp->idx, inp->val, iev.value);*/
|
||||
break;
|
||||
|
||||
case EV_KEY:
|
||||
|
@ -225,12 +225,12 @@ static int read_evdev(struct device *dev, struct dev_input *inp)
|
|||
|
||||
case EV_SYN:
|
||||
inp->type = INP_FLUSH;
|
||||
printf("[%s] EV_SYN\n", dev->name);
|
||||
/*printf("[%s] EV_SYN\n", dev->name);*/
|
||||
break;
|
||||
|
||||
default:
|
||||
if(verbose) {
|
||||
printf("unexpected event: %d\n", iev.type);
|
||||
printf("unhandled event: %d\n", iev.type);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -132,7 +132,6 @@ void process_input(struct device *dev, struct dev_input *inp)
|
|||
inp->idx = cfg.map_axis[inp->idx];
|
||||
|
||||
if(abs(inp->val) < cfg.dead_threshold[inp->idx] ) {
|
||||
printf("clamping axis %d event with value %d in deadzone\n", inp->idx, inp->val);
|
||||
inp->val = 0;
|
||||
}
|
||||
sign = cfg.invert[inp->idx] ? -1 : 1;
|
||||
|
@ -212,13 +211,8 @@ int in_deadzone(struct device *dev)
|
|||
if((dev_ev = device_event_in_use(dev)) == NULL)
|
||||
return -1;
|
||||
for(i=0; i<6; i++) {
|
||||
int val = dev_ev->event.motion.data[i];
|
||||
if(val != 0) {
|
||||
if(abs(val) < cfg.dead_threshold[i]) {
|
||||
printf("BUG %d on axis %d not in deadzone? (%d)\n", dev_ev->event.motion.data[i], i, cfg.dead_threshold[i]);
|
||||
}
|
||||
if(dev_ev->event.motion.data[i] != 0)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue