summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/joystick.man28
-rw-r--r--src/jstk.c19
2 files changed, 40 insertions, 7 deletions
diff --git a/man/joystick.man b/man/joystick.man
index da92ceb..b401de5 100644
--- a/man/joystick.man
+++ b/man/joystick.man
@@ -140,7 +140,11 @@ Neither
.B mode
nor
.B axis
-needs to be set to generate extra valuator events.
+needs to be set to generate extra valuator events. The axis will be labelled according to it's physical axis number, beginning with
+.I 1
+, i.e.
+.I \*qAxis 1\*q
+for the first axis (being the 3rd valuator).
Default: not set.
.TP 7
.BI "\*qaxis="[<factor>]<axis> \*q
@@ -318,6 +322,28 @@ and the second and fourth axis to the arrow keys
The keys for the first two axes will be generated in an interval according to the value of the axis. The autorepeat speed of the first axis will be half the speed of that of the second axis.
The keys for the third and fourth axis are generated once when the axis moves out of the deadzone and when it moves back into the deadzone. X.Org will autorepeat those keys according to current keyboard settings.
+.SH "XI2 Events"
+If you only care about raw events instead of using the joystick as a mouse replacement, don't forget to unmap and add valuators to all axes and map the remaining buttons:
+
+.nf
+.BI " Option \*qMapAxis1\*q \*q" "mode=none valuator" \*q
+.BI " Option \*qMapAxis2\*q \*q" "mode=none valuator" \*q
+.BI " Option \*qMapAxis3\*q \*q" "mode=none valuator" \*q
+.BI " Option \*qMapAxis4\*q \*q" "mode=none valuator" \*q
+\ \ ...
+.BI " Option \*qMapButton1\*q \*q" "button=1" \*q
+.BI " Option \*qMapButton2\*q \*q" "button=2" \*q
+.BI " Option \*qMapButton3\*q \*q" "button=3" \*q
+.BI " Option \*qMapButton4\*q \*q" "button=4" \*q
+.BI " Option \*qMapButton5\*q \*q" "button=5" \*q
+\ \ ...
+.fi
+
+You might also want to set the device "floating" to stop it from reporting core events:
+.nf
+.BI " Option \*qFloating\*q \*q" "true" \*q
+.fi
+
.SH "NOTES"
Configuration through
.I InputClass
diff --git a/src/jstk.c b/src/jstk.c
index 6db0e7c..772683f 100644
--- a/src/jstk.c
+++ b/src/jstk.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2007-2009 by Sascha Hlusiak. <saschahlusiak@freedesktop.org>
+ * Copyright 2007-2011 by Sascha Hlusiak. <saschahlusiak@freedesktop.org>
* Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@ -21,7 +21,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -300,6 +299,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
switch (what) {
case DEVICE_INIT: {
int m;
+ char str[32];
CARD8 buttonmap[BUTTONMAP_SIZE+1];
DBG(1, ErrorF("jstkDeviceControlProc what=INIT\n"));
/* Probe device and return if error */
@@ -312,11 +312,14 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
}
for (m=0; m<=BUTTONMAP_SIZE; m++) {
+ sprintf(str, "Button %d", m);
+
buttonmap[m] = m;
- }
+ btn_labels[m] = MakeAtom(str, strlen(str), TRUE);
+ }
+
+
-
-
if (InitButtonClassDeviceStruct(pJstk, BUTTONMAP_SIZE,
btn_labels,
buttonmap) == FALSE) {
@@ -331,7 +334,9 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
if (priv->axis[i].valuator != -1)
{
DBG(3, ErrorF("Axis %d will be valuator %d\n", i, m));
+ sprintf(str, "Axis %d", i + 1);
priv->axis[i].valuator = m++;
+ axes_labels[i] = MakeAtom(str, strlen(str), TRUE);
}
if (InitValuatorClassDeviceStruct(pJstk, m, axes_labels,
@@ -719,7 +724,6 @@ static XF86ModuleVersionInfo jstkVersionRec =
/* a tool */
};
-
/*
***************************************************************************
*
@@ -732,3 +736,6 @@ _X_EXPORT XF86ModuleData joystickModuleData = {
jstkDriverPlug,
jstkDriverUnplug
};
+
+/* vim: set filetype=c.doxygen ts=4 et: */
+