summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSascha Hlusiak <saschahlusiak@arcor.de>2007-07-07 23:33:32 +0200
committerSascha Hlusiak <saschahlusiak@arcor.de>2007-07-07 23:33:32 +0200
commit321e4395486b66b2b7be0510494f48b2a03a4cc8 (patch)
tree4a81cf86b950c321b5a2f5ce352999db91f966af /src
parent1e72e8111b637a0dd784077b09c220d53a133520 (diff)
Reverted commit a24a5eeb30b224abf2bb512619fe5ab7284fa252 (prepare for keymap)
The files and methods will be added back when it is time. So far there is no need for jstk_key.* files and dummy methods.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/jstk.c2
-rw-r--r--src/jstk_key.c109
-rw-r--r--src/jstk_key.h31
-rw-r--r--src/jstk_options.c10
5 files changed, 6 insertions, 147 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 147c537..2987e21 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -30,7 +30,6 @@
@DRIVER_NAME@_drv_la_SOURCES = jstk.c jstk.h jstk_hw.h \
jstk_axis.c jstk_axis.h \
- jstk_key.c jstk_key.h \
jstk_options.c jstk_options.h
BSD_SRCS = bsd_jstk.c
diff --git a/src/jstk.c b/src/jstk.c
index 543f76f..d1a52a4 100644
--- a/src/jstk.c
+++ b/src/jstk.c
@@ -41,7 +41,6 @@
#include "jstk.h"
#include "jstk_hw.h"
#include "jstk_axis.h"
-#include "jstk_key.h"
#include "jstk_options.h"
@@ -271,7 +270,6 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
return !Success;
}
}
- jstkInitKeys(pJstk, priv);
m = 2;
for (i=0; i<MAXAXES; i++)
diff --git a/src/jstk_key.c b/src/jstk_key.c
deleted file mode 100644
index abe9f1b..0000000
--- a/src/jstk_key.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright 2007 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
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * 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.
- *
- * 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
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * 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.
- */
-
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-
-#include <xf86.h>
-#include <X11/extensions/XKB.h>
-#include <X11/extensions/XKBstr.h>
-#include <X11/extensions/XKBsrv.h>
-#include <X11/keysym.h>
-#include <X11/XF86keysym.h>
-#include "jstk.h"
-#include "jstk_key.h"
-
-#define MIN_KEYCODE 8
-
-
-/**
- * Xorg should allow us to have a separate keymap
- * If a keyboard is defined, there already is a keymap and we have to use it
- * If not, we have to provide our own keymap
- *
- * Since we don't know we do NOTHING. :-( So we assume, you have a keyboard attached
- **/
-
-
-int
-jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv)
-{
-/* KeySymsRec keySyms;
- CARD8 modMap[MAP_LENGTH];
- KeySym sym;
- int i, j;
- XkbComponentNamesRec xkbnames;
-
- static struct { KeySym keysym; CARD8 mask; } modifiers[] = {
- { XK_Shift_L, ShiftMask },
- { XK_Shift_R, ShiftMask },
- { XK_Control_L, ControlMask },
- { XK_Control_R, ControlMask },
- { XK_Caps_Lock, LockMask }
- { XK_Alt_L, AltMask },
- { XK_Alt_R, AltMask },
- { XK_Num_Lock, NumLockMask },
- { XK_Scroll_Lock, ScrollLockMask },
- { XK_Mode_switch, AltLangMask }
- };
-
- priv->keymap.size = 20;
- for (i = 0; i < 20; i++)
- priv->keymap.map[i] = XK_at;
-
- memset(modMap, 0, sizeof modMap);
-
- for (i = 0; i < priv->keymap.size; i++) {
- sym = priv->keymap.map[i];
- for (j = 0; j < sizeof(modifiers)/sizeof(modifiers[0]); j++) {
- if (modifiers[j].keysym == sym)
- modMap[i + MIN_KEYCODE] = modifiers[j].mask;
- }
- }
-
- keySyms.map = priv->keymap.map;
- keySyms.mapWidth = 1;
- keySyms.minKeyCode = MIN_KEYCODE;
- keySyms.maxKeyCode = MIN_KEYCODE + priv->keymap.size - 1;
-
- XkbSetRulesDflts(__XKBDEFRULES__, "pc105", "de", "nodeadkeys", NULL);
-
- XkbInitKeyboardDeviceStruct (pJstk, &xkbnames, &keySyms, modMap,
- NULL, NULL);
-*/
-
- return Success;
-}
-
-
-
-
-
-
-
-
-
diff --git a/src/jstk_key.h b/src/jstk_key.h
deleted file mode 100644
index bbc3b59..0000000
--- a/src/jstk_key.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2007 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
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * 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.
- *
- * 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
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * 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.
- */
-
-
-#ifndef __JSTK_KEY_H_INCLUDED__
-#define __JSTK_KEY_H_INCLUDED__
-
-int jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv);
-
-
-#endif
diff --git a/src/jstk_options.c b/src/jstk_options.c
index e07445c..b4a08a6 100644
--- a/src/jstk_options.c
+++ b/src/jstk_options.c
@@ -128,9 +128,10 @@ jstkParseButtonOption(const char* org,
button->mapping = MAPPING_BUTTON;
button->buttonnumber = jstkGetButtonNumberInMap(priv, value);
} else if (sscanf(param, "axis=%15s", p) == 1) {
+ p[15]='\0';
button->mapping = jstkGetAxisMapping(&fvalue, p, name);
button->amplify = fvalue;
- button->currentspeed = 1.0;
+ button->currentspeed = 1.0f;
if (button->mapping == MAPPING_NONE)
xf86Msg(X_WARNING, "%s: error parsing axis: %s.\n",
name, p);
@@ -139,6 +140,7 @@ jstkParseButtonOption(const char* org,
button->amplify = fvalue;
} else if (sscanf(param, "key=%30s", p) == 1) {
char *current, *next;
+ p[30]='\0';
current = p;
button->mapping = MAPPING_KEY;
for (value = 0; value < MAXKEYSPERBUTTON; value++) if (current != NULL) {
@@ -188,12 +190,12 @@ jstkParseAxisOption(const char* org, AXIS *axis, const char *name)
if ((tmp=strstr(param, "mode=")) != NULL) {
if (sscanf(tmp, "mode=%15s", p) == 1) {
- p[15]='\0';
+ p[15] = '\0';
if (strcmp(p, "relative") == 0)
axis->type = TYPE_BYVALUE;
else if (strcmp(p, "accelerated") == 0) {
axis->type = TYPE_ACCELERATED;
- axis->currentspeed = 1.0;
+ axis->currentspeed = 1.0f;
} else if (strcmp(p, "absolute") == 0)
axis->type = TYPE_ABSOLUTE;
else if (strcmp(p, "none") == 0)
@@ -210,7 +212,7 @@ jstkParseAxisOption(const char* org, AXIS *axis, const char *name)
if ((tmp = strstr(param, "axis=")) != NULL) {
if (sscanf(tmp, "axis=%15s", p) == 1) {
p[15] = '\0';
- fvalue = 1.0;
+ fvalue = 1.0f;
axis->mapping = jstkGetAxisMapping(&fvalue, p, name);
if ((axis->type == TYPE_ABSOLUTE) &&
((fvalue <= 1.1)&&(fvalue >= -1.1))) {