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.
This commit is contained in:
Zephaniah E. Hull
2006-04-14 07:01:37 +00:00
parent c968040cde
commit cffc51e04a
4 changed files with 30 additions and 11 deletions

View File

@@ -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):

View File

@@ -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 {

View File

@@ -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;
}

View File

@@ -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;