View | Details | Raw Unified | Return to bug 144682
Collapse All | Expand All

(-)ChangeLog (+6 lines)
Lines 1-3 Link Here
1
2006-04-20  Matthias Hopf  <mhopf@suse.de>
2
3
	* src/mouse.c: (MousePostEvent):
4
	Overhaul of wheel processing. Does work correctly with multibit
5
	zaxis events now.
6
1
2006-04-06  Adam Jackson  <ajax@freedesktop.org>
7
2006-04-06  Adam Jackson  <ajax@freedesktop.org>
2
8
3
	* configure.ac:
9
	* configure.ac:
(-)src/mouse.c (-19 / +49 lines)
Lines 2332-2338 MousePostEvent(InputInfoPtr pInfo, int t Link Here
2332
	       int dx, int dy, int dz, int dw)
2332
	       int dx, int dy, int dz, int dw)
2333
{
2333
{
2334
    MouseDevPtr pMse;
2334
    MouseDevPtr pMse;
2335
    int zbutton = 0;
2335
    int zbutton = 0, wbutton = 0, zbuttoncount = 0, wbuttoncount = 0;
2336
    int i, b, buttons = 0;
2336
    int i, b, buttons = 0;
2337
2337
2338
    pMse = pInfo->private;
2338
    pMse = pInfo->private;
Lines 2353-2358 MousePostEvent(InputInfoPtr pInfo, int t Link Here
2353
    /* XXX Could this go in the conversion_proc? */
2353
    /* XXX Could this go in the conversion_proc? */
2354
    switch (pMse->negativeZ) {
2354
    switch (pMse->negativeZ) {
2355
    case MSE_NOZMAP:	/* do nothing */
2355
    case MSE_NOZMAP:	/* do nothing */
2356
	dz = 0;
2356
	break;
2357
	break;
2357
    case MSE_MAPTOX:
2358
    case MSE_MAPTOX:
2358
	if (dz != 0) {
2359
	if (dz != 0) {
Lines 2367-2386 MousePostEvent(InputInfoPtr pInfo, int t Link Here
2367
	}
2368
	}
2368
	break;
2369
	break;
2369
    default:	/* buttons */
2370
    default:	/* buttons */
2370
	buttons &= ~(pMse->negativeZ | pMse->positiveZ
2371
	buttons &= ~(pMse->negativeZ | pMse->positiveZ);
2371
		   | pMse->negativeW | pMse->positiveW);
2372
	if (dz < 0) {
2372
	if (dw < 0 || dz < -1)
2373
	    zbutton = pMse->negativeW;
2374
	else if (dz < 0)
2375
	    zbutton = pMse->negativeZ;
2373
	    zbutton = pMse->negativeZ;
2376
	else if (dw > 0 || dz > 1)
2374
	    zbuttoncount = -dz;
2377
	    zbutton = pMse->positiveW;
2375
	} else if (dz > 0) {
2378
	else if (dz > 0)
2379
	    zbutton = pMse->positiveZ;
2376
	    zbutton = pMse->positiveZ;
2380
	buttons |= zbutton;
2377
	    zbuttoncount = dz;
2378
	}
2381
	dz = 0;
2379
	dz = 0;
2382
	break;
2380
	break;
2383
    }
2381
    }
2382
    switch (pMse->negativeW) {
2383
    case MSE_NOZMAP:	/* do nothing */
2384
	dw = 0;
2385
	break;
2386
    case MSE_MAPTOX:
2387
	if (dw != 0) {
2388
	    dx = dw;
2389
	    dw = 0;
2390
	}
2391
	break;
2392
    case MSE_MAPTOY:
2393
	if (dw != 0) {
2394
	    dy = dw;
2395
	    dw = 0;
2396
	}
2397
	break;
2398
    default:	/* buttons */
2399
	buttons &= ~(pMse->negativeW | pMse->positiveW);
2400
	if (dw < 0) {
2401
	    wbutton = pMse->negativeW;
2402
	    wbuttoncount = -dw;
2403
	} else if (dw > 0) {
2404
	    wbutton = pMse->positiveW;
2405
	    wbuttoncount = dw;
2406
	}
2407
	dw = 0;
2408
	break;
2409
    }
2410
2384
2411
2385
    /* Apply angle offset */
2412
    /* Apply angle offset */
2386
    if (pMse->angleOffset != 0) {
2413
    if (pMse->angleOffset != 0) {
Lines 2397-2412 MousePostEvent(InputInfoPtr pInfo, int t Link Here
2397
	dx = dy;
2424
	dx = dy;
2398
	dy = tmp;
2425
	dy = tmp;
2399
    }
2426
    }
2400
    MouseDoPostEvent(pInfo, buttons, dx, dy);
2401
2427
2402
    /*
2428
    /* If mouse wheel movement has to be mapped on a button, we need to
2403
     * If dz has been mapped to a button `down' event, we need to cook up
2429
     * loop for button press and release events. */
2404
     * a corresponding button `up' event.
2430
    do {
2405
     */
2431
        MouseDoPostEvent(pInfo, buttons | zbutton | wbutton, dx, dy);
2406
    if (zbutton) {
2432
	dx = dy = 0;
2407
	buttons &= ~zbutton;
2433
	if (zbutton || wbutton)
2408
	MouseDoPostEvent(pInfo, buttons, 0, 0);
2434
	    MouseDoPostEvent(pInfo, buttons, 0, 0);
2409
    }
2435
	if (--zbuttoncount <= 0)
2436
	    zbutton = 0;
2437
	if (--wbuttoncount <= 0)
2438
	    wbutton = 0;
2439
    } while (zbutton || wbutton);
2410
2440
2411
    pMse->lastButtons = truebuttons;
2441
    pMse->lastButtons = truebuttons;
2412
}
2442
}

Return to bug 144682