aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZephaniah E. Hull <warp@aehallh.com>2006-04-14 07:01:37 +0000
committerZephaniah E. Hull <warp@aehallh.com>2006-04-14 07:01:37 +0000
commitcffc51e04aba0090dfb663d2927117318b5ea00c (patch)
tree59f0279f214a77e551bd18d28000c911e56d034c
parentRemove a debugging message. (diff)
downloadxf86-input-evdev-cffc51e04aba0090dfb663d2927117318b5ea00c.tar.gz
xf86-input-evdev-cffc51e04aba0090dfb663d2927117318b5ea00c.tar.bz2
xf86-input-evdev-cffc51e04aba0090dfb663d2927117318b5ea00c.zip
evdevAbsRec: Remove the scale bool, rename scale_x and scale_y to scale[2].
evdevAxesRec: Make btnMap an int array instead of a Card8 array. Make abs support and non-core stuff actually work. Relative emulation for abs mode is still a bit broken, but that's far less critical. How many buttons we've registered is configuration information, not an error message.
-rw-r--r--ChangeLog17
-rw-r--r--src/evdev.h6
-rw-r--r--src/evdev_axes.c16
-rw-r--r--src/evdev_btn.c2
4 files changed, 30 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index d0500a5..e7fe1d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2006-04-14 Zephaniah E. Hull <warp@aehallh.com>
+
+ * src/evdev.h:
+ evdevAbsRec: Remove the scale bool, rename scale_x and scale_y
+ to scale[2].
+ evdevAxesRec: Make btnMap an int array instead of a Card8 array.
+ * src/evdev_axes.c: (EvdevAxesAbsSyn), (EvdevAxesAbsProcess),
+ (EvdevAxisAbsNew), (EvdevAxesInit):
+ Make abs support and non-core stuff actually work.
+
+ Relative emulation for abs mode is still a bit broken, but that's far
+ less critical.
+
+ * src/evdev_btn.c: (EvdevBtnInit):
+ How many buttons we've registered is configuration information, not an
+ error message.
+
2006-04-08 Zephaniah E. Hull <warp@aehallh.com>
* src/evdev.c: (EvdevCorePreInit):
diff --git a/src/evdev.h b/src/evdev.h
index 80e01f1..ffe8cc1 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -153,9 +153,7 @@ typedef struct {
int min[ABS_MAX];
int max[ABS_MAX];
int map[ABS_MAX];
- Bool scale;
- int scale_x;
- int scale_y;
+ int scale[2];
int screen; /* Screen number for this device. */
} evdevAbsRec, *evdevAbsPtr;
@@ -169,7 +167,7 @@ typedef struct {
typedef struct {
int axes;
int v[ABS_MAX];
- CARD8 btnMap[ABS_MAX][2];
+ int btnMap[ABS_MAX][2];
} evdevAxesRec, *evdevAxesPtr;
typedef struct {
diff --git a/src/evdev_axes.c b/src/evdev_axes.c
index 55de247..dbeb889 100644
--- a/src/evdev_axes.c
+++ b/src/evdev_axes.c
@@ -205,6 +205,7 @@ EvdevAxesAbsSyn (InputInfoPtr pInfo)
return;
n = state->abs->n & 1;
+ state->abs->n++;
i = 0;
if (state->mode == Relative && state->abs->axes >= 2) {
@@ -215,8 +216,8 @@ EvdevAxesAbsSyn (InputInfoPtr pInfo)
int conv_x, conv_y;
for (i = 0; i < 2; i++)
- state->abs->v[n][i] = xf86ScaleAxis (state->abs->v[n][i], 0,
- state->abs->scale_x,
+ state->axes->v[i] = xf86ScaleAxis (state->abs->v[n][i],
+ 0, state->abs->scale[i],
state->abs->min[i], state->abs->max[i]);
@@ -269,11 +270,12 @@ EvdevAxesAbsProcess (InputInfoPtr pInfo, struct input_event *ev)
if (ev->code >= ABS_MAX)
return;
+ /* FIXME: Handle inverted axes properly. */
map = state->abs->map[ev->code];
if (map >= 0)
- state->abs->v[n][map] += ev->value;
+ state->abs->v[n][map] = ev->value;
else
- state->abs->v[n][-map] -= ev->value;
+ state->abs->v[n][-map] = ev->value;
state->abs->count++;
@@ -399,8 +401,8 @@ EvdevAxisAbsNew(InputInfoPtr pInfo)
xf86Msg(X_CONFIG, "%s: AbsoluteScreen: %d is not a valid screen.\n", pInfo->name, k);
}
- state->abs->scale_x = screenInfo.screens[state->abs->screen]->width;
- state->abs->scale_y = screenInfo.screens[state->abs->screen]->height;
+ state->abs->scale[0] = screenInfo.screens[state->abs->screen]->width;
+ state->abs->scale[1] = screenInfo.screens[state->abs->screen]->height;
return Success;
}
@@ -542,6 +544,8 @@ EvdevAxesInit (DeviceIntPtr device)
if (!InitPtrFeedbackClassDeviceStruct(device, EvdevPtrCtrlProc))
return !Success;
+ xf86MotionHistoryAllocate (pInfo);
+
return Success;
}
diff --git a/src/evdev_btn.c b/src/evdev_btn.c
index b9cd60d..4c25245 100644
--- a/src/evdev_btn.c
+++ b/src/evdev_btn.c
@@ -87,7 +87,7 @@ EvdevBtnInit (DeviceIntPtr device)
for (i = 0; i <= pEvdev->state.btn->buttons; i++)
map[i] = i;
- xf86Msg(X_ERROR, "%s (%d): Registering %d buttons.\n", __FILE__, __LINE__,
+ xf86Msg(X_CONFIG, "%s (%d): Registering %d buttons.\n", __FILE__, __LINE__,
pEvdev->state.btn->buttons);
if (!InitButtonClassDeviceStruct (device, pEvdev->state.btn->buttons, map)) {
pEvdev->state.btn->buttons = 0;