summaryrefslogtreecommitdiff
path: root/src/evdev_axes.c
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 /src/evdev_axes.c
parentc968040cde4e1a7c73332701008f6abfb1fa3ab3 (diff)
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.
Diffstat (limited to 'src/evdev_axes.c')
-rw-r--r--src/evdev_axes.c16
1 files changed, 10 insertions, 6 deletions
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;
}