diff options
author | Sascha Hlusiak <saschahlusiak@arcor.de> | 2008-10-01 21:43:49 +0200 |
---|---|---|
committer | Sascha Hlusiak <saschahlusiak@arcor.de> | 2008-10-01 21:59:30 +0200 |
commit | 33a15ca531556c419797ddfe2a2c034c1e263f65 (patch) | |
tree | 4af7d1dfa936372d123bb5527423a67b1592ad04 /src | |
parent | 4e16c39c0eb06eb96ee699a905fe1a1d490e2c69 (diff) |
Option for per-axis valuators. Defaults to off for all axes.
Old: Each axis had an extra valuator, starting with 2 (0 and 1 are pointer movement)
New: Add "valuator" to axis option to give it an extra valuator of range -32768 to 32768.
Default: Off for all axes, since rarely used (and broken anyway right now).
Diffstat (limited to 'src')
-rw-r--r-- | src/jstk.c | 9 | ||||
-rw-r--r-- | src/jstk_options.c | 4 |
2 files changed, 10 insertions, 3 deletions
@@ -343,8 +343,11 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, m = 2; for (i=0; i<MAXAXES; i++) - if (priv->axis[i].type != TYPE_NONE) - priv->axis[i].valuator = m++; + if (priv->axis[i].valuator != -1) + { + DBG(3, ErrorF("Axis %d will be valuator %d\n", i, m)); + priv->axis[i].valuator = m++; + } if (InitValuatorClassDeviceStruct(pJstk, m, @@ -371,7 +374,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, 0, /* min_res */ 1); /* max_res */ for (i=0; i<MAXAXES; i++) - if (priv->axis[i].type != TYPE_NONE) + if (priv->axis[i].valuator != -1) { InitValuatorAxisStruct(pJstk, priv->axis[i].valuator, diff --git a/src/jstk_options.c b/src/jstk_options.c index 510c160..804747b 100644 --- a/src/jstk_options.c +++ b/src/jstk_options.c @@ -275,6 +275,10 @@ jstkParseAxisOption(const char* org, name); } + if ((tmp = strstr(param, "valuator")) != NULL ) { + axis->valuator = 0; /* Will be renumbered appropriately on DEVICE_INIT */ + } + if ((tmp = strstr(param, "keylow=")) != NULL) { if (sscanf(tmp, "keylow=%30s", p) == 1) { char *current, *next; |