diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-04-08 17:03:04 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-04-08 17:03:04 +0000 |
commit | 4cea424722f693056b29bbb75bbea24484405a76 (patch) | |
tree | e5ef0256bef0db347ce6ea0a101779fb776c0664 /driver/xf86-input-joystick/src/jstk.c | |
parent | 413dde04d4bd1ed42bd20e19694fd7e50f98776e (diff) |
Update to xf86-input-joystick 1.6.1
Diffstat (limited to 'driver/xf86-input-joystick/src/jstk.c')
-rw-r--r-- | driver/xf86-input-joystick/src/jstk.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/driver/xf86-input-joystick/src/jstk.c b/driver/xf86-input-joystick/src/jstk.c index ec6b79ad0..772683fb9 100644 --- a/driver/xf86-input-joystick/src/jstk.c +++ b/driver/xf86-input-joystick/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, @@ -419,8 +424,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, default: ErrorF("unsupported mode=%d\n", what); - return !Success; - break; + return BadValue; } /* switch (what) */ return Success; } @@ -720,7 +724,6 @@ static XF86ModuleVersionInfo jstkVersionRec = /* a tool */ }; - /* *************************************************************************** * @@ -733,3 +736,6 @@ _X_EXPORT XF86ModuleData joystickModuleData = { jstkDriverPlug, jstkDriverUnplug }; + +/* vim: set filetype=c.doxygen ts=4 et: */ + |