From cffc51e04aba0090dfb663d2927117318b5ea00c Mon Sep 17 00:00:00 2001 From: "Zephaniah E. Hull" Date: Fri, 14 Apr 2006 07:01:37 +0000 Subject: 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. --- src/evdev_axes.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/evdev_axes.c') 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; } -- cgit v1.2.3