|
Line
Link Here
|
| 0 |
-- xf86-input-evdev-1.1.5/src/evdev.h |
0 |
++ xf86-input-evdev-1.1.5/src/evdev.h |
|
Lines 162-173
Link Here
|
| 162 |
|
162 |
|
| 163 |
typedef struct { |
163 |
typedef struct { |
| 164 |
int axes; |
164 |
int axes; |
| 165 |
int v[ABS_MAX]; |
165 |
int v[ABS_MAX+1]; |
| 166 |
int old_x, old_y; |
166 |
int old_x, old_y; |
| 167 |
int count; |
167 |
int count; |
| 168 |
int min[ABS_MAX]; |
168 |
int min[ABS_MAX+1]; |
| 169 |
int max[ABS_MAX]; |
169 |
int max[ABS_MAX+1]; |
| 170 |
int map[ABS_MAX]; |
170 |
int map[ABS_MAX+1]; |
| 171 |
int scale[2]; |
171 |
int scale[2]; |
| 172 |
int screen; /* Screen number for this device. */ |
172 |
int screen; /* Screen number for this device. */ |
| 173 |
Bool use_touch; |
173 |
Bool use_touch; |
|
Lines 177-191
Link Here
|
| 177 |
|
177 |
|
| 178 |
typedef struct { |
178 |
typedef struct { |
| 179 |
int axes; |
179 |
int axes; |
| 180 |
int v[REL_MAX]; |
180 |
int v[REL_MAX+1]; |
| 181 |
int count; |
181 |
int count; |
| 182 |
int map[REL_MAX]; |
182 |
int map[REL_MAX+1]; |
| 183 |
int btnMap[REL_MAX][2]; |
183 |
int btnMap[REL_MAX+1][2]; |
| 184 |
} evdevRelRec, *evdevRelPtr; |
184 |
} evdevRelRec, *evdevRelPtr; |
| 185 |
|
185 |
|
| 186 |
typedef struct { |
186 |
typedef struct { |
| 187 |
int axes; |
187 |
int axes; |
| 188 |
int v[ABS_MAX]; |
188 |
int v[ABS_MAX+1]; |
| 189 |
} evdevAxesRec, *evdevAxesPtr; |
189 |
} evdevAxesRec, *evdevAxesPtr; |
| 190 |
|
190 |
|
| 191 |
typedef struct { |
191 |
typedef struct { |
| 192 |
-- xf86-input-evdev-1.1.5/src/evdev_axes.c |
192 |
++ xf86-input-evdev-1.1.5/src/evdev_axes.c |
|
Lines 206-215
Link Here
|
| 206 |
axes->v[0x3c], axes->v[0x3d], axes->v[0x3e], axes->v[0x3f]); |
206 |
axes->v[0x3c], axes->v[0x3d], axes->v[0x3e], axes->v[0x3f]); |
| 207 |
|
207 |
|
| 208 |
if (!skip_xy) |
208 |
if (!skip_xy) |
| 209 |
for (i = 0; i < ABS_MAX; i++) |
209 |
for (i = 0; i <= ABS_MAX; i++) |
| 210 |
state->axes->v[i] = 0; |
210 |
state->axes->v[i] = 0; |
| 211 |
else if (skip_xy == 1) |
211 |
else if (skip_xy == 1) |
| 212 |
for (i = 2; i < ABS_MAX; i++) |
212 |
for (i = 2; i <= ABS_MAX; i++) |
| 213 |
state->axes->v[i] = 0; |
213 |
state->axes->v[i] = 0; |
| 214 |
else if (skip_xy == 2) |
214 |
else if (skip_xy == 2) |
| 215 |
for (i = 0; i < 2; i++) |
215 |
for (i = 0; i < 2; i++) |
|
Lines 224-230
Link Here
|
| 224 |
struct input_absinfo absinfo; |
224 |
struct input_absinfo absinfo; |
| 225 |
int i; |
225 |
int i; |
| 226 |
|
226 |
|
| 227 |
for (i = 0; i < ABS_MAX; i++) { |
227 |
for (i = 0; i <= ABS_MAX; i++) { |
| 228 |
if (!test_bit (i, pEvdev->bits.abs)) |
228 |
if (!test_bit (i, pEvdev->bits.abs)) |
| 229 |
continue; |
229 |
continue; |
| 230 |
|
230 |
|
|
Lines 288-294
Link Here
|
| 288 |
xf86XInputSetScreen (pInfo, state->abs->screen, conv_x, conv_y); |
288 |
xf86XInputSetScreen (pInfo, state->abs->screen, conv_x, conv_y); |
| 289 |
} |
289 |
} |
| 290 |
|
290 |
|
| 291 |
for (; i < ABS_MAX; i++) |
291 |
for (; i <= ABS_MAX; i++) |
| 292 |
state->axes->v[i] = state->abs->v[i]; |
292 |
state->axes->v[i] = state->abs->v[i]; |
| 293 |
|
293 |
|
| 294 |
EvdevAxesRealSyn (pInfo, 1, skip_xy); |
294 |
EvdevAxesRealSyn (pInfo, 1, skip_xy); |
|
Lines 306-312
Link Here
|
| 306 |
if (!state->axes || !state->rel || !state->rel->count) |
306 |
if (!state->axes || !state->rel || !state->rel->count) |
| 307 |
return; |
307 |
return; |
| 308 |
|
308 |
|
| 309 |
for (i = 0; i < REL_MAX; i++) { |
309 |
for (i = 0; i <= REL_MAX; i++) { |
| 310 |
if (rel->btnMap[i][0] || rel->btnMap[i][1]) { |
310 |
if (rel->btnMap[i][0] || rel->btnMap[i][1]) { |
| 311 |
if ((rel->v[i] > 0) && (btn = rel->btnMap[i][0])) |
311 |
if ((rel->v[i] > 0) && (btn = rel->btnMap[i][0])) |
| 312 |
EvdevBtnPostFakeClicks (pInfo, btn, rel->v[i]); |
312 |
EvdevBtnPostFakeClicks (pInfo, btn, rel->v[i]); |
|
Lines 343-349
Link Here
|
| 343 |
evdevStatePtr state = &pEvdev->state; |
343 |
evdevStatePtr state = &pEvdev->state; |
| 344 |
int map; |
344 |
int map; |
| 345 |
|
345 |
|
| 346 |
if (ev->code >= ABS_MAX) |
346 |
if (ev->code > ABS_MAX) |
| 347 |
return; |
347 |
return; |
| 348 |
|
348 |
|
| 349 |
/* FIXME: Handle inverted axes properly. */ |
349 |
/* FIXME: Handle inverted axes properly. */ |
|
Lines 366-372
Link Here
|
| 366 |
evdevStatePtr state = &pEvdev->state; |
366 |
evdevStatePtr state = &pEvdev->state; |
| 367 |
int map; |
367 |
int map; |
| 368 |
|
368 |
|
| 369 |
if (ev->code >= REL_MAX) |
369 |
if (ev->code > REL_MAX) |
| 370 |
return; |
370 |
return; |
| 371 |
|
371 |
|
| 372 |
map = state->rel->map[ev->code]; |
372 |
map = state->rel->map[ev->code]; |
|
Lines 403-409
Link Here
|
| 403 |
int i, j, k = 0, real_axes; |
403 |
int i, j, k = 0, real_axes; |
| 404 |
|
404 |
|
| 405 |
real_axes = 0; |
405 |
real_axes = 0; |
| 406 |
for (i = 0; i < ABS_MAX; i++) |
406 |
for (i = 0; i <= ABS_MAX; i++) |
| 407 |
if (test_bit (i, pEvdev->bits.abs)) |
407 |
if (test_bit (i, pEvdev->bits.abs)) |
| 408 |
real_axes++; |
408 |
real_axes++; |
| 409 |
|
409 |
|
|
Lines 419-425
Link Here
|
| 419 |
pInfo->type_name = XI_MOUSE; |
419 |
pInfo->type_name = XI_MOUSE; |
| 420 |
pInfo->conversion_proc = EvdevConvert; |
420 |
pInfo->conversion_proc = EvdevConvert; |
| 421 |
|
421 |
|
| 422 |
for (i = 0, j = 0; i < ABS_MAX; i++) { |
422 |
for (i = 0, j = 0; i <= ABS_MAX; i++) { |
| 423 |
if (!test_bit (i, pEvdev->bits.abs)) |
423 |
if (!test_bit (i, pEvdev->bits.abs)) |
| 424 |
continue; |
424 |
continue; |
| 425 |
|
425 |
|
|
Lines 444-450
Link Here
|
| 444 |
} |
444 |
} |
| 445 |
|
445 |
|
| 446 |
state->abs->axes = real_axes; |
446 |
state->abs->axes = real_axes; |
| 447 |
for (i = 0; i < ABS_MAX; i++) { |
447 |
for (i = 0; i <= ABS_MAX; i++) { |
| 448 |
if (state->abs->map[i] > state->abs->axes) |
448 |
if (state->abs->map[i] > state->abs->axes) |
| 449 |
state->abs->axes = state->abs->map[i]; |
449 |
state->abs->axes = state->abs->map[i]; |
| 450 |
} |
450 |
} |
|
Lines 525-531
Link Here
|
| 525 |
int i, j, k = 0, real_axes; |
525 |
int i, j, k = 0, real_axes; |
| 526 |
|
526 |
|
| 527 |
real_axes = 0; |
527 |
real_axes = 0; |
| 528 |
for (i = 0; i < REL_MAX; i++) |
528 |
for (i = 0; i <= REL_MAX; i++) |
| 529 |
if (test_bit (i, pEvdev->bits.rel)) |
529 |
if (test_bit (i, pEvdev->bits.rel)) |
| 530 |
real_axes++; |
530 |
real_axes++; |
| 531 |
|
531 |
|
|
Lines 542-548
Link Here
|
| 542 |
pInfo->type_name = XI_MOUSE; |
542 |
pInfo->type_name = XI_MOUSE; |
| 543 |
pInfo->conversion_proc = EvdevConvert; |
543 |
pInfo->conversion_proc = EvdevConvert; |
| 544 |
|
544 |
|
| 545 |
for (i = 0, j = 0; i < REL_MAX; i++) { |
545 |
for (i = 0, j = 0; i <= REL_MAX; i++) { |
| 546 |
if (!test_bit (i, pEvdev->bits.rel)) |
546 |
if (!test_bit (i, pEvdev->bits.rel)) |
| 547 |
continue; |
547 |
continue; |
| 548 |
|
548 |
|
|
Lines 579-585
Link Here
|
| 579 |
} |
579 |
} |
| 580 |
|
580 |
|
| 581 |
state->rel->axes = real_axes; |
581 |
state->rel->axes = real_axes; |
| 582 |
for (i = 0; i < REL_MAX; i++) |
582 |
for (i = 0; i <= REL_MAX; i++) |
| 583 |
if (state->rel->map[i] > state->rel->axes) |
583 |
if (state->rel->map[i] > state->rel->axes) |
| 584 |
state->rel->axes = state->rel->map[i]; |
584 |
state->rel->axes = state->rel->map[i]; |
| 585 |
|
585 |
|