diff --git a/.gitignore b/.gitignore index c23adc5..74ae1a8 100644 --- a/.gitignore +++ b/.gitignore @@ -71,7 +71,7 @@ core *.tar.bz2 *.tar.gz # -# Add & Override patterns for +# Add & Override patterns for # # Edit the following section as needed # For example, !report.pc overrides *.pc. See 'man gitignore' diff --git a/COPYING b/COPYING index 2f3bc01..9d9f24d 100644 --- a/COPYING +++ b/COPYING @@ -1,5 +1,5 @@ -Copyright 2007-2008 by Sascha Hlusiak. - +Copyright 2007-2008 by Sascha Hlusiak. + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that @@ -8,8 +8,8 @@ documentation, and that the name of Sascha Hlusiak not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Sascha Hlusiak makes no representations about the suitability of this software for any purpose. It -is provided "as is" without express or implied warranty. - +is provided "as is" without express or implied warranty. + SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -18,9 +18,9 @@ DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -Copyright 2007-2009 by Sascha Hlusiak. -Copyright 1995-1999 by Frederic Lepied, France. - +Copyright 2007-2009 by Sascha Hlusiak. +Copyright 1995-1999 by Frederic Lepied, France. + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that @@ -29,8 +29,8 @@ documentation, and that the names of copyright holders not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The copyright holders make no representations about the suitability of this software for any purpose. It -is provided "as is" without express or implied warranty. - +is provided "as is" without express or implied warranty. + THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR diff --git a/config/50-joystick-all.conf b/config/50-joystick-all.conf index 0723086..6a3ef89 100644 --- a/config/50-joystick-all.conf +++ b/config/50-joystick-all.conf @@ -34,7 +34,7 @@ Section "InputClass" Option "MapAxis5" "mode=accelerated axis=+1x deadzone=5000" Option "MapAxis6" "mode=accelerated axis=+1y deadzone=5000" - + # Map Alt+Tab to button #4 # Option "MapButton4" "key=64+23" @@ -47,7 +47,7 @@ Section "InputClass" # Map button #10 to Space # Option "MapButton10" "key=65" - # Map axis #1 and #2 to the keycodes for Left, Right, Up and Down rather + # Map axis #1 and #2 to the keycodes for Left, Right, Up and Down rather # than pointer movement # Option "MapAxis1" "mode=accelerated keylow=113 keyhigh=114" # Option "MapAxis2" "mode=accelerated keylow=111 keyhigh=116" diff --git a/config/50-x11-input-joystick.fdi b/config/50-x11-input-joystick.fdi index aec77b0..9f3311c 100644 --- a/config/50-x11-input-joystick.fdi +++ b/config/50-x11-input-joystick.fdi @@ -10,13 +10,13 @@ input.keys input.mouse --> - + joystick - - - button=1 diff --git a/configure.ac b/configure.ac index df83369..1f315ce 100644 --- a/configure.ac +++ b/configure.ac @@ -127,7 +127,7 @@ AC_OUTPUT # ----------------------------------------------------------------------------- -AS_ECHO() +AS_ECHO() AS_ECHO("Building Linux joystick backend: $linux_backend") AS_ECHO("Building Linux evdev backend: $evdev_backend") AS_ECHO("Building BSD usbhid backend: $bsd_backend") diff --git a/include/joystick-properties.h b/include/joystick-properties.h index 36f4082..c5f901c 100644 --- a/include/joystick-properties.h +++ b/include/joystick-properties.h @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR diff --git a/man/Makefile.am b/man/Makefile.am index 4e045d9..057e105 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -19,7 +19,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. -# +# drivermandir = $(DRIVER_MAN_DIR) diff --git a/src/backend_bsd.c b/src/backend_bsd.c index 248cde3..70de826 100644 --- a/src/backend_bsd.c +++ b/src/backend_bsd.c @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -190,7 +190,7 @@ jstkOpenDevice_bsd(JoystickDevPtr joystick, Bool probe) bsddata->hotdata = 0; if (probe == TRUE) { - xf86Msg(X_INFO, "Joystick: %d buttons, %d axes\n", + xf86Msg(X_INFO, "Joystick: %d buttons, %d axes\n", joystick->num_buttons, joystick->num_axes); } @@ -242,7 +242,7 @@ jstkReadData_bsd(JoystickDevPtr joystick, int *number) { int j,d; - struct jstk_bsd_hid_data *bsddata = + struct jstk_bsd_hid_data *bsddata = (struct jstk_bsd_hid_data*)(joystick->devicedata); if (event != NULL) *event = EVENT_NONE; @@ -260,9 +260,9 @@ jstkReadData_bsd(JoystickDevPtr joystick, for (j=0; jnum_axes - (bsddata->hats * 2); j++) { d = hid_get_data(bsddata->data_buf, &bsddata->axis_item[j]); /* Scale the range to our expected range of -32768 to 32767 */ - d = d - (bsddata->axis_item[j].logical_maximum + d = d - (bsddata->axis_item[j].logical_maximum - bsddata->axis_item[j].logical_minimum) / 2; - d = d * 65536 / (bsddata->axis_item[j].logical_maximum + d = d * 65536 / (bsddata->axis_item[j].logical_maximum - bsddata->axis_item[j].logical_minimum); if (abs(d) < joystick->axis[j].deadzone) d = 0; if (d != joystick->axis[j].value) { @@ -275,13 +275,13 @@ jstkReadData_bsd(JoystickDevPtr joystick, for (j=0; jhats; j++) { int a; - int v1_data[9] = + int v1_data[9] = { 0, 32767, 32767, 32767, 0, -32768, -32768, -32768, 0 }; int v2_data[9] = { -32768, -32768, 0, 32767, 32767, 32767, 0, -32767, 0 }; a = j*2 + joystick->num_axes - bsddata->hats *2; - d = hid_get_data(bsddata->data_buf, &bsddata->hat_item[j]) + d = hid_get_data(bsddata->data_buf, &bsddata->hat_item[j]) - bsddata->hat_item[j].logical_minimum; if (joystick->axis[a].value != v1_data[d]) { joystick->axis[a].value = v1_data[d]; diff --git a/src/backend_bsd.h b/src/backend_bsd.h index b3205fc..4f37993 100644 --- a/src/backend_bsd.h +++ b/src/backend_bsd.h @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR diff --git a/src/backend_evdev.c b/src/backend_evdev.c index 20a2ca7..f36f1f9 100644 --- a/src/backend_evdev.c +++ b/src/backend_evdev.c @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -81,7 +81,7 @@ static int jstkReadData_evdev(JoystickDevPtr joystick, * jstkOpenDevice -- * * Open and initialize a joystick device. The device name is - * taken from JoystickDevPtr + * taken from JoystickDevPtr * Returns the filedescriptor, or -1 in case of error * *********************************************************************** @@ -108,7 +108,7 @@ jstkOpenDevice_evdev(JoystickDevPtr joystick, Bool probe) } if (ioctl(joystick->fd, EVIOCGVERSION, &driver_version) == -1) { - xf86Msg(X_ERROR, "Joystick: ioctl EVIOCGVERSION on '%s' failed: %s\n", + xf86Msg(X_ERROR, "Joystick: ioctl EVIOCGVERSION on '%s' failed: %s\n", joystick->device, strerror(errno)); jstkCloseDevice_evdev(joystick); return -1; @@ -257,7 +257,7 @@ jstkReadData_evdev(JoystickDevPtr joystick, data = (struct jstk_evdev_data*)joystick->devicedata; DBG(10, if (iev.type) - ErrorF("Event (evdev): type: 0x%04X, code: 0x%04X, value: 0x%04X\n", + ErrorF("Event (evdev): type: 0x%04X, code: 0x%04X, value: 0x%04X\n", (unsigned int)iev.type, (unsigned int)iev.code, (int)iev.value)); @@ -284,21 +284,21 @@ jstkReadData_evdev(JoystickDevPtr joystick, * - 0..256, with a center of 127 (Logitech Dual Action axes) * - 0..256 with a center of 0 (XBox left/right triggers) * - -32768..32768 with a center of 0 (XBox axes) - * + * * These ranges will ALL be scaled to -32768..32768, with * the center value to be assumed 0. This is for compatibility * with the legacy joystick module, which reports values in * the same range. - * - * The value is also important for the deadzone, which can be + * + * The value is also important for the deadzone, which can be * configured by the user and is in -32768..32768 range. - * + * * TODO: how to respect center value, so that that XBox triggers * and logitech axes report idle, when not moved? * TODO: report all values as -1.0f..1.0f, but this would possibly * break config file semantics. */ - + float v = (float) iev.value; v = (v - (float)axis->min) * 65535.0f / (axis->max - axis->min) - 32768.0f; @@ -322,8 +322,8 @@ jstkReadData_evdev(JoystickDevPtr joystick, default: DBG(3, if (iev.type) ErrorF("Unhandled evdev event: type: 0x%04X, code: 0x%04X, " - "value: 0x%04X\n", - (unsigned int)iev.type, + "value: 0x%04X\n", + (unsigned int)iev.type, (unsigned int)iev.code, (int)iev.value)); } diff --git a/src/backend_evdev.h b/src/backend_evdev.h index d63b657..75c148a 100644 --- a/src/backend_evdev.h +++ b/src/backend_evdev.h @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR diff --git a/src/backend_joystick.c b/src/backend_joystick.c index 8964d21..bfcf96c 100644 --- a/src/backend_joystick.c +++ b/src/backend_joystick.c @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -68,7 +68,7 @@ static int jstkReadData_joystick(JoystickDevPtr joystick, * jstkOpenDevice -- * * Open and initialize a joystick device. The device name is - * taken from JoystickDevPtr + * taken from JoystickDevPtr * Returns the filedescriptor, or -1 in case of error * *********************************************************************** @@ -90,7 +90,7 @@ jstkOpenDevice_joystick(JoystickDevPtr joystick, Bool probe) } if (ioctl(joystick->fd, JSIOCGVERSION, &driver_version) == -1) { - xf86Msg(X_ERROR, "Joystick: ioctl JSIOCGVERSION on '%s' failed: %s\n", + xf86Msg(X_ERROR, "Joystick: ioctl JSIOCGVERSION on '%s' failed: %s\n", joystick->device, strerror(errno)); jstkCloseDevice(joystick); return -1; @@ -103,28 +103,28 @@ jstkOpenDevice_joystick(JoystickDevPtr joystick, Bool probe) } if (ioctl(joystick->fd, JSIOCGAXES, &axes) == -1) { - xf86Msg(X_ERROR, "Joystick: ioctl JSIOCGAXES on '%s' failed: %s\n", + xf86Msg(X_ERROR, "Joystick: ioctl JSIOCGAXES on '%s' failed: %s\n", joystick->device, strerror(errno)); jstkCloseDevice(joystick); return -1; } if (ioctl(joystick->fd, JSIOCGBUTTONS, &buttons) == -1) { - xf86Msg(X_ERROR, "Joystick: ioctl JSIOCGBUTTONS on '%s' failed: %s\n", + xf86Msg(X_ERROR, "Joystick: ioctl JSIOCGBUTTONS on '%s' failed: %s\n", joystick->device, strerror(errno)); jstkCloseDevice(joystick); return -1; } if (ioctl(joystick->fd, JSIOCGNAME(128), joy_name) == -1) { - xf86Msg(X_ERROR, "Joystick: ioctl JSIOCGNAME on '%s' failed: %s\n", + xf86Msg(X_ERROR, "Joystick: ioctl JSIOCGNAME on '%s' failed: %s\n", joystick->device, strerror(errno)); jstkCloseDevice(joystick); return -1; } if (probe == TRUE) { - xf86Msg(X_INFO, "Joystick: %s. %d axes, %d buttons\n", + xf86Msg(X_INFO, "Joystick: %s. %d axes, %d buttons\n", joy_name, axes, buttons); } diff --git a/src/backend_joystick.h b/src/backend_joystick.h index c8df19a..02ae2c7 100644 --- a/src/backend_joystick.h +++ b/src/backend_joystick.h @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR diff --git a/src/jstk.c b/src/jstk.c index 5cdfccd..db5023a 100644 --- a/src/jstk.c +++ b/src/jstk.c @@ -1,7 +1,7 @@ /* - * Copyright 2007-2011 by Sascha Hlusiak. - * Copyright 1995-1999 by Frederic Lepied, France. - * + * Copyright 2007-2011 by Sascha Hlusiak. + * Copyright 1995-1999 by Frederic Lepied, France. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -10,8 +10,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. The copyright holders make no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -142,7 +142,7 @@ jstkReadProc(InputInfoPtr pInfo) JoystickDevPtr priv = pInfo->private; do { - if ((priv->read_proc == NULL) || + if ((priv->read_proc == NULL) || ((r=priv->read_proc(priv, &event, &number))==0)) { xf86Msg(X_WARNING, "JOYSTICK: Read failed. Deactivating device.\n"); @@ -153,8 +153,8 @@ jstkReadProc(InputInfoPtr pInfo) /* A button's status changed */ if (event == EVENT_BUTTON) { - DBG(4, ErrorF("Button %d %s. Mapping: %d\n", number, - (priv->button[number].pressed == 0) ? "released" : "pressed", + DBG(4, ErrorF("Button %d %s. Mapping: %d\n", number, + (priv->button[number].pressed == 0) ? "released" : "pressed", priv->button[number].mapping)); switch (priv->button[number].mapping) { @@ -170,7 +170,7 @@ jstkReadProc(InputInfoPtr pInfo) case JSTK_MAPPING_Y: case JSTK_MAPPING_ZX: case JSTK_MAPPING_ZY: - if (priv->button[number].pressed == 0) + if (priv->button[number].pressed == 0) priv->button[number].currentspeed = 1.0; else if (priv->mouse_enabled == TRUE) jstkStartButtonAxisTimer(pInfo, number); @@ -178,8 +178,8 @@ jstkReadProc(InputInfoPtr pInfo) case JSTK_MAPPING_KEY: if (priv->keys_enabled == TRUE) - jstkGenerateKeys(priv->keyboard_device, - priv->button[number].keys, + jstkGenerateKeys(priv->keyboard_device, + priv->button[number].keys, priv->button[number].pressed); break; @@ -187,7 +187,7 @@ jstkReadProc(InputInfoPtr pInfo) priv->amplify = 1.0; /* Calculate new amplify value by multiplying them all */ for (i=0; ibutton[i].pressed) && + if ((priv->button[i].pressed) && (priv->button[i].mapping == JSTK_MAPPING_SPEED_MULTIPLY)) priv->amplify *= priv->button[i].amplify; } @@ -196,7 +196,7 @@ jstkReadProc(InputInfoPtr pInfo) case JSTK_MAPPING_DISABLE: if (priv->button[number].pressed == 1) { - if ((priv->mouse_enabled == TRUE) || + if ((priv->mouse_enabled == TRUE) || (priv->keys_enabled == TRUE)) { priv->mouse_enabled = FALSE; @@ -211,19 +211,19 @@ jstkReadProc(InputInfoPtr pInfo) break; case JSTK_MAPPING_DISABLE_MOUSE: if (priv->button[number].pressed == 1) { - if (priv->mouse_enabled == TRUE) + if (priv->mouse_enabled == TRUE) priv->mouse_enabled = FALSE; else priv->mouse_enabled = TRUE; - DBG(2, ErrorF("Mouse events %s\n", + DBG(2, ErrorF("Mouse events %s\n", priv->mouse_enabled ? "enabled" : "disabled")); } break; case JSTK_MAPPING_DISABLE_KEYS: if (priv->button[number].pressed == 1) { - if (priv->keys_enabled == TRUE) + if (priv->keys_enabled == TRUE) priv->keys_enabled = FALSE; else priv->keys_enabled = TRUE; - DBG(2, ErrorF("Keyboard events %s\n", + DBG(2, ErrorF("Keyboard events %s\n", priv->mouse_enabled ? "enabled" : "disabled")); } break; @@ -234,10 +234,10 @@ jstkReadProc(InputInfoPtr pInfo) } /* An axis was moved */ - if ((event == EVENT_AXIS) && + if ((event == EVENT_AXIS) && (priv->axis[number].type != JSTK_TYPE_NONE)) { - DBG(5, ErrorF("Axis %d moved to %d. Type: %d, Mapping: %d\n", + DBG(5, ErrorF("Axis %d moved to %d. Type: %d, Mapping: %d\n", number, priv->axis[number].value, priv->axis[number].type, @@ -344,7 +344,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, xorg_btn_labels[7] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_SIDE); xorg_btn_labels[8] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_EXTRA); xorg_btn_labels[9] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_FORWARD); - xorg_btn_labels[10] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_BACK); + xorg_btn_labels[10] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_BACK); for (m=0; m<=BUTTONMAP_SIZE; m++) { if (m <= 10) { @@ -354,7 +354,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, } - if (InitButtonClassDeviceStruct(pJstk, BUTTONMAP_SIZE, + if (InitButtonClassDeviceStruct(pJstk, BUTTONMAP_SIZE, btn_labels, buttonmap) == FALSE) { ErrorF("unable to allocate Button class device\n"); @@ -364,7 +364,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, return !Success; m = 2; - for (i=0; iaxis[i].valuator != -1) { DBG(3, ErrorF("Axis %d will be valuator %d\n", i, m)); @@ -376,7 +376,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, if (InitValuatorClassDeviceStruct(pJstk, m, axes_labels, GetMotionHistorySize(), Relative) == FALSE) { - ErrorF("unable to allocate Valuator class device\n"); + ErrorF("unable to allocate Valuator class device\n"); return !Success; } else { InitValuatorAxisStruct(pJstk, @@ -397,10 +397,10 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, 0, /* min_res */ 0, /* max_res */ Relative); - for (i=0; iaxis[i].valuator != -1) { - + InitValuatorAxisStruct(pJstk, priv->axis[i].valuator, axes_labels[i], @@ -421,7 +421,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, } case DEVICE_ON: - DBG(1, ErrorF("jstkDeviceControlProc what=ON name=%s\n", + DBG(1, ErrorF("jstkDeviceControlProc what=ON name=%s\n", priv->device)); if (jstkOpenDevice(priv, FALSE) != -1) { @@ -435,7 +435,7 @@ jstkDeviceControlProc(DeviceIntPtr pJstk, case DEVICE_CLOSE: if (!pJstk->public.on) break; - DBG(1, ErrorF("jstkDeviceControlProc what=%s\n", + DBG(1, ErrorF("jstkDeviceControlProc what=%s\n", (what == DEVICE_CLOSE) ? "CLOSE" : "OFF")); if (priv->timerrunning == TRUE) { @@ -595,12 +595,12 @@ jstkCorePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) #if DEBUG debug_level = xf86SetIntOption(pInfo->options, "DebugLevel", 0); if (debug_level > 0) { - xf86Msg(X_CONFIG, "%s: debug level set to %d\n", + xf86Msg(X_CONFIG, "%s: debug level set to %d\n", pInfo->name, debug_level); } #else if (xf86SetIntOption(pInfo->options, "DebugLevel", 0) != 0) { - xf86Msg(X_WARNING, "%s: DebugLevel: Compiled without debugging support!\n", + xf86Msg(X_WARNING, "%s: DebugLevel: Compiled without debugging support!\n", pInfo->name); } #endif @@ -616,7 +616,7 @@ jstkCorePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) if (s != NULL) { jstkParseButtonOption(s, priv, i, pInfo->name); } - DBG(1, xf86Msg(X_CONFIG, "Button %d mapped to %d\n", i+1, + DBG(1, xf86Msg(X_CONFIG, "Button %d mapped to %d\n", i+1, priv->button[i].mapping)); } @@ -628,8 +628,8 @@ jstkCorePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) if (s != NULL) { jstkParseAxisOption(s, priv, &priv->axis[i], pInfo->name); } - DBG(1, xf86Msg(X_CONFIG, - "Axis %d type is %d, mapped to %d, amplify=%.3f\n", i+1, + DBG(1, xf86Msg(X_CONFIG, + "Axis %d type is %d, mapped to %d, amplify=%.3f\n", i+1, priv->axis[i].type, priv->axis[i].mapping, priv->axis[i].amplify)); @@ -659,7 +659,7 @@ SetupProc_fail: * This is a bit tricky, because the keyboard device and the main device * share the same private data, which must be freed only once, which is done * by the main device. - * + * * *************************************************************************** */ @@ -673,7 +673,7 @@ jstkCoreUnInit(InputDriverPtr drv, JoystickDevPtr priv = (JoystickDevPtr) pInfo->private; if (priv->keyboard_device == pInfo) { /* this is the keyboard device */ - /* Unlink from private data to notify that the + /* Unlink from private data to notify that the * keyboard device is no more, but don't free */ priv->keyboard_device = NULL; } else { @@ -682,7 +682,7 @@ jstkCoreUnInit(InputDriverPtr drv, private data is gone */ if (priv->keyboard_device) priv->keyboard_device->private = NULL; - + free (priv); } } diff --git a/src/jstk.h b/src/jstk.h index 087389e..3fe09e7 100644 --- a/src/jstk.h +++ b/src/jstk.h @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -95,7 +95,7 @@ typedef struct _BUTTON { JSTK_MAPPING mapping; char pressed; int buttonnumber; /* MAPPING_BUTTON */ - float amplify; /* MAPPING_X/Y/ZX/ZY, + float amplify; /* MAPPING_X/Y/ZX/ZY, MAPPING_SPEED_MULTIPLY */ float currentspeed; /* MAPPING_X/Y/ZX/ZY */ float subpixel; /* Pending subpixel movement */ diff --git a/src/jstk_axis.c b/src/jstk_axis.c index 2f9793b..ea44adb 100644 --- a/src/jstk_axis.c +++ b/src/jstk_axis.c @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -88,25 +88,25 @@ jstkAxisTimer(OsTimerPtr timer, * * make sure that diagonal movement feels fast. either: * 1) linear - * + * * f(32768) ~= f(23170) + f(23170) * f(32768) ~= a * f(23170) * a = 2.0 * * on circular joysticks, the time needed for xy movement is * exactly the time needed for x + the time for y separately. - * absolute diagonal travel speed (in cm/s) is 0.707 times as fast, + * absolute diagonal travel speed (in cm/s) is 0.707 times as fast, * which feels pretty slow. * * on square joysticks, diagonal travel speed is always 1.41 times * faster than orthogonal travel speed. time needed for diagonal * movement is always 0.5 times as long as for orthogonal movement. - * + * * the value of a = 2.0 results in a nice, non-linear acceleration. * * or * 2) trigonometric - * + * * f(32768) ~= sqrt(f(23170)^2 + f(23170)^2)) * f(32768) ~= a * f(23170) * a = 1.414 @@ -115,22 +115,22 @@ jstkAxisTimer(OsTimerPtr timer, * (in cm/s) is now the same for both linear and diagonal movement, * which feels natural. moving diagonally takes 0.707 times the time * of moving orthogonally. - * + * * on square joysticks, values are as in 1) - * + * * the value of a = 1.414 results in linear acceleration, which feels * too slow. - * + * * to maintain non-linear acceleration, make sure that: * - * a >>= 1.414 + * a >>= 1.414 * * the following formula achieves results in between, * so it should feel natural on both devices while maintaining a * nice acceleration: - * + * * f(32768) ~= 1.620 * f(23170) - * + * * TODO: make this simpler by using only values -1.0..1.0 and * provide acceleration graphs. */ @@ -186,7 +186,7 @@ jstkAxisTimer(OsTimerPtr timer, movezy += (int)axis->subpixel; break; - case JSTK_MAPPING_KEY: if ((priv->keys_enabled == TRUE) && + case JSTK_MAPPING_KEY: if ((priv->keys_enabled == TRUE) && (priv->axis[i].type == JSTK_TYPE_BYVALUE)) { int num; num = abs((int)axis->subpixel); @@ -215,7 +215,7 @@ jstkAxisTimer(OsTimerPtr timer, float p2; if (priv->button[i].currentspeed < 100.0f) - priv->button[i].currentspeed = + priv->button[i].currentspeed = (priv->button[i].currentspeed + 3.0f) * 1.07f - 3.0f; p1 = priv->button[i].currentspeed * (float)NEXTTIMER / 180.0f * priv->button[i].amplify; @@ -280,9 +280,9 @@ jstkAxisTimer(OsTimerPtr timer, } while (movezx >= 1) { /* right */ - xf86PostButtonEvent(device, 0, 7, + xf86PostButtonEvent(device, 0, 7, 1, 0, 0); - xf86PostButtonEvent(device, 0, 7, + xf86PostButtonEvent(device, 0, 7, 0, 0, 0); movezx -= 1; } @@ -335,7 +335,7 @@ jstkStartAxisTimer(InputInfoPtr device, int number) DBG(2, ErrorF("Starting Axis Timer (triggered by axis %d)\n", number)); priv->timer = TimerSet( - priv->timer, + priv->timer, 0, /* Relative */ 1, /* What about NOW? */ jstkAxisTimer, @@ -376,7 +376,7 @@ jstkStartButtonAxisTimer(InputInfoPtr device, int number) DBG(2, ErrorF("Starting Axis Timer (triggered by button %d)\n", number)); priv->timer = TimerSet( - priv->timer, + priv->timer, 0, /* Relative */ 1, /* What about NOW? */ jstkAxisTimer, @@ -388,7 +388,7 @@ jstkStartButtonAxisTimer(InputInfoPtr device, int number) * jstkHandleAbsoluteAxis -- * * Sums up absolute movement of all axes and sets the cursor to the - * desired Position on the screen. + * desired Position on the screen. * *********************************************************************** */ @@ -401,12 +401,12 @@ jstkHandleAbsoluteAxis(InputInfoPtr device, int number) x=0; y=0; - for (i=0; iaxis[i].type == JSTK_TYPE_ABSOLUTE) { float rel; int dif; - + rel = 0.0f; if (priv->axis[i].value > +priv->axis[i].deadzone) rel = (priv->axis[i].value - priv->axis[i].deadzone); @@ -480,24 +480,24 @@ jstkPWMAxisTimer(OsTimerPtr timer, DBG(8, ErrorF("PWM Axis %d value %d (old %d)\n", i, axis->value, axis->oldvalue)); /* Force key_high down if centered */ - if ((axis->value <= 0) && + if ((axis->value <= 0) && (axis->oldvalue > 0) && - (axis->key_isdown)) + (axis->key_isdown)) { DBG(7, ErrorF("PWM Axis %d jumped over. Forcing keys_high up.\n", i)); - jstkGenerateKeys(priv->keyboard_device, + jstkGenerateKeys(priv->keyboard_device, axis->keys_high, 0); axis->key_isdown = 0; } /* Force key_low down if centered */ - if ((axis->value >= 0) && + if ((axis->value >= 0) && (axis->oldvalue < 0) && (axis->key_isdown)) { DBG(7, ErrorF("PWM Axis %d jumped over. Forcing keys_low up.\n", i)); - jstkGenerateKeys(priv->keyboard_device, + jstkGenerateKeys(priv->keyboard_device, axis->keys_low, 0); axis->key_isdown = 0; @@ -544,7 +544,7 @@ jstkPWMAxisTimer(OsTimerPtr timer, axis->key_isdown); } nexttimer = 0; - } else if (time_on > 600.0f) { + } else if (time_on > 600.0f) { /* Might as well just have it up forever */ DBG(7, ErrorF("PWM Axis %d down time too long (%.0fms). Forcing down)\n", i, time_on)); if (axis->key_isdown == 0) { @@ -598,10 +598,10 @@ jstkHandlePWMAxis(InputInfoPtr device, int number) priv->axis[number].timerrunning = TRUE; - DBG(2, ErrorF("Starting PWM Axis Timer (triggered by axis %d, value %d)\n", + DBG(2, ErrorF("Starting PWM Axis Timer (triggered by axis %d, value %d)\n", number, priv->axis[number].value)); priv->axis[number].timer = TimerSet( - priv->axis[number].timer, + priv->axis[number].timer, 0, /* Relative */ 1, /* What about NOW? */ jstkPWMAxisTimer, diff --git a/src/jstk_axis.h b/src/jstk_axis.h index 0d672db..c01535e 100644 --- a/src/jstk_axis.h +++ b/src/jstk_axis.h @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR diff --git a/src/jstk_key.c b/src/jstk_key.c index 1e44ddb..830b6c7 100644 --- a/src/jstk_key.c +++ b/src/jstk_key.c @@ -1,7 +1,7 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * Copyright 1995-1999 by Frederic Lepied, France. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * Copyright 1995-1999 by Frederic Lepied, France. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -10,8 +10,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. The copyright holders make no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -78,8 +78,8 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv) } /* Set Autorepeat and Delay */ - if ((priv->repeat_delay || priv->repeat_interval) && - pJstk->key && + if ((priv->repeat_delay || priv->repeat_interval) && + pJstk->key && pJstk->key->xkbInfo) { xkbi = pJstk->key->xkbInfo; @@ -101,7 +101,7 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv) * * jstkGenerateKeys * - * Generates a series of keydown or keyup events of the specified + * Generates a series of keydown or keyup events of the specified * KEYSCANCODES * *************************************************************************** @@ -115,12 +115,12 @@ jstkGenerateKeys(InputInfoPtr device, KEYSCANCODES keys, char pressed) if (device == NULL) return; for (i=0;idev, k, pressed); } diff --git a/src/jstk_key.h b/src/jstk_key.h index fc0c782..26a4ee4 100644 --- a/src/jstk_key.h +++ b/src/jstk_key.h @@ -1,7 +1,7 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * Copyright 1995-1999 by Frederic Lepied, France. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * Copyright 1995-1999 by Frederic Lepied, France. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -10,8 +10,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. The copyright holders make no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR diff --git a/src/jstk_options.c b/src/jstk_options.c index 6bb18db..15e42e6 100644 --- a/src/jstk_options.c +++ b/src/jstk_options.c @@ -1,6 +1,6 @@ /* * Copyright 2007 - 2008 by Sascha Hlusiak. - * + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -45,7 +45,7 @@ * jstkGetAxisMapping -- * * Parses strings like: - * x, +y, -zx, 3x, 3.5zy, -8x + * x, +y, -zx, 3x, 3.5zy, -8x * And returns the mapping and stores the optional factor * In the float referenced by 'value' * @@ -53,7 +53,7 @@ */ static JSTK_MAPPING -jstkGetAxisMapping(float *value, const char* param, const char* name) +jstkGetAxisMapping(float *value, const char* param, const char* name) { if (sscanf(param, "%f", value)==0) { if (param[0] == '-') @@ -104,7 +104,7 @@ jstkParseButtonOption(const char* org, button->mapping = JSTK_MAPPING_NONE; } else if (sscanf(param, "button=%d", &value) == 1) { if (value<0 || value >BUTTONMAP_SIZE) { - xf86Msg(X_WARNING, "%s: button number out of range (0..%d): %d.\n", + xf86Msg(X_WARNING, "%s: button number out of range (0..%d): %d.\n", name, BUTTONMAP_SIZE, value); } else { button->mapping = JSTK_MAPPING_BUTTON; @@ -117,7 +117,7 @@ jstkParseButtonOption(const char* org, button->amplify = fvalue; button->currentspeed = 1.0f; if (button->mapping == JSTK_MAPPING_NONE) - xf86Msg(X_WARNING, "%s: error parsing axis: %s.\n", + xf86Msg(X_WARNING, "%s: error parsing axis: %s.\n", name, p); } else if (sscanf(param, "amplify=%f", &fvalue) == 1) { button->mapping = JSTK_MAPPING_SPEED_MULTIPLY; @@ -136,7 +136,7 @@ jstkParseButtonOption(const char* org, key = strtol(current, NULL, 0); DBG(3, ErrorF("Parsed %s to %d\n", current, key)); if (key == 0) - xf86Msg(X_WARNING, "%s: error parsing key value: %s.\n", + xf86Msg(X_WARNING, "%s: error parsing key value: %s.\n", name, current); else { button->keys[value] = key; @@ -150,7 +150,7 @@ jstkParseButtonOption(const char* org, } else if (strcmp(param, "disable-keys") == 0) { button->mapping = JSTK_MAPPING_DISABLE_KEYS; } else { - xf86Msg(X_WARNING, "%s: error parsing button parameter.\n", + xf86Msg(X_WARNING, "%s: error parsing button parameter.\n", name); } free(param); @@ -169,7 +169,7 @@ jstkParseButtonOption(const char* org, */ void -jstkParseAxisOption(const char* org, +jstkParseAxisOption(const char* org, JoystickDevPtr priv, AXIS *axis, const char *name) @@ -195,10 +195,10 @@ jstkParseAxisOption(const char* org, axis->type = JSTK_TYPE_NONE; } else { axis->type = JSTK_TYPE_NONE; - xf86Msg(X_WARNING, "%s: \"%s\": error parsing mode.\n", + xf86Msg(X_WARNING, "%s: \"%s\": error parsing mode.\n", name, param); } - } else xf86Msg(X_WARNING, "%s: \"%s\": error parsing mode.\n", + } else xf86Msg(X_WARNING, "%s: \"%s\": error parsing mode.\n", name, param); } @@ -233,7 +233,7 @@ jstkParseAxisOption(const char* org, p[30]='\0'; current = p; axis->mapping = JSTK_MAPPING_KEY; - for (value = 0; value < MAXKEYSPERBUTTON; value++) + for (value = 0; value < MAXKEYSPERBUTTON; value++) if (current != NULL) { next = strchr(current, ','); if (!next) next = strchr(current, '+'); @@ -242,7 +242,7 @@ jstkParseAxisOption(const char* org, key = strtol(current, NULL, 0); DBG(3, ErrorF("Parsed %s to %d\n", current, key)); if (key == 0) - xf86Msg(X_WARNING, "%s: error parsing keylow value: %s.\n", + xf86Msg(X_WARNING, "%s: error parsing keylow value: %s.\n", name, current); else { axis->keys_low[value] = key; @@ -259,7 +259,7 @@ jstkParseAxisOption(const char* org, p[30]='\0'; current = p; axis->mapping = JSTK_MAPPING_KEY; - for (value = 0; value < MAXKEYSPERBUTTON; value++) + for (value = 0; value < MAXKEYSPERBUTTON; value++) if (current != NULL) { next = strchr(current, ','); if (!next) next = strchr(current, '+'); @@ -268,7 +268,7 @@ jstkParseAxisOption(const char* org, key = strtol(current, NULL, 0); DBG(3, ErrorF("Parsed %s to %d\n", current, key)); if (key == 0) - xf86Msg(X_WARNING, "%s: error parsing keyhigh value: %s.\n", + xf86Msg(X_WARNING, "%s: error parsing keyhigh value: %s.\n", name, current); else { axis->keys_high[value] = key; @@ -282,11 +282,11 @@ jstkParseAxisOption(const char* org, if (sscanf(tmp, "deadzone=%d", &value) == 1) { value = (value < 0) ? (-value) : (value); if (value > 30000) - xf86Msg(X_WARNING, - "%s: deadzone of %d seems unreasonable. Ignored.\n", + xf86Msg(X_WARNING, + "%s: deadzone of %d seems unreasonable. Ignored.\n", name, value); else axis->deadzone = value; - }else xf86Msg(X_WARNING, "%s: error parsing deadzone.\n", + }else xf86Msg(X_WARNING, "%s: error parsing deadzone.\n", name); } free(param); diff --git a/src/jstk_options.h b/src/jstk_options.h index 6fe2d1d..d3d2afa 100644 --- a/src/jstk_options.h +++ b/src/jstk_options.h @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -24,7 +24,7 @@ #ifndef __JSTK_OPTIONS_H_INCLUDED__ #define __JSTK_OPTIONS_H_INCLUDED__ -void jstkParseButtonOption(const char* org, +void jstkParseButtonOption(const char* org, JoystickDevPtr priv, int number, const char* name); diff --git a/src/jstk_properties.c b/src/jstk_properties.c index 3ff9e83..f70a59b 100644 --- a/src/jstk_properties.c +++ b/src/jstk_properties.c @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -119,7 +119,7 @@ jstkSetProperty(DeviceIntPtr pJstk, Atom atom, XIPropertyValuePtr val, if (val->size != priv->num_axes || val->format != 32 || val->type != XA_INTEGER) return BadMatch; values = (INT32*)val->data; - for (i =0; isize; i++) /* Fail, if one value is out of range */ + for (i =0; isize; i++) /* Fail, if one value is out of range */ if (values[i] > 30000 || values[i] < -30000) return BadValue; if (!checkonly) diff --git a/src/jstk_properties.h b/src/jstk_properties.h index fe6290f..8e92eb7 100644 --- a/src/jstk_properties.h +++ b/src/jstk_properties.h @@ -1,6 +1,6 @@ /* - * Copyright 2007-2008 by Sascha Hlusiak. - * + * Copyright 2007-2008 by Sascha Hlusiak. + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Sascha Hlusiak makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR