Dont pass wheel mouse buttons as real buttons, map them as Z-Axis movement
on SCO and USL. Re-instate the ZAxisMapping default for the mouse driver.
This commit is contained in:
parent
1b26fe6d20
commit
e4554db8f8
|
@ -123,14 +123,8 @@ OsMouseProc (DeviceIntPtr pPointer, int what)
|
||||||
}
|
}
|
||||||
xf86Msg (from, "%s: Buttons: %d\n", pInfo->name, pMse->buttons);
|
xf86Msg (from, "%s: Buttons: %d\n", pInfo->name, pMse->buttons);
|
||||||
|
|
||||||
map[1] = 1;
|
for (evi = 0; evi <= 8; evi++)
|
||||||
map[2] = 2;
|
map[evi] = evi;
|
||||||
map[3] = 3;
|
|
||||||
map[4] = 7;
|
|
||||||
map[5] = 8;
|
|
||||||
map[6] = 6;
|
|
||||||
map[7] = 4;
|
|
||||||
map[8] = 5; /* Compatibile with SCO X server */
|
|
||||||
|
|
||||||
InitPointerDeviceStruct((DevicePtr)pPointer, map, 8,
|
InitPointerDeviceStruct((DevicePtr)pPointer, map, 8,
|
||||||
miPointerGetMotionEvents, pMse->Ctrl,
|
miPointerGetMotionEvents, pMse->Ctrl,
|
||||||
|
@ -185,15 +179,16 @@ OsMouseReadInput (InputInfoPtr pInfo)
|
||||||
|
|
||||||
while ((evp = ev_read()) != (EVENT *)0) {
|
while ((evp = ev_read()) != (EVENT *)0) {
|
||||||
int buttons = EV_BUTTONS(*evp);
|
int buttons = EV_BUTTONS(*evp);
|
||||||
int dx = EV_DX(*evp), dy = -(EV_DY(*evp));
|
int dx = EV_DX(*evp), dy = -(EV_DY(*evp)), dz = 0;
|
||||||
|
|
||||||
if (EV_TAG(*evp) & T_WHEEL) {
|
if (buttons & WHEEL_FWD)
|
||||||
pMse->PostEvent (pInfo, buttons, 0, 0, 0, 0);
|
dz = -1;
|
||||||
/* Simulate button release */
|
else if (buttons & WHEEL_BACK)
|
||||||
buttons &= ~(WHEEL_FWD | WHEEL_BACK);
|
dz = 1;
|
||||||
}
|
|
||||||
|
|
||||||
pMse->PostEvent (pInfo, buttons, dx, dy, 0, 0);
|
buttons &= ~(WHEEL_FWD | WHEEL_BACK);
|
||||||
|
|
||||||
|
pMse->PostEvent (pInfo, buttons, dx, dy, dz, 0);
|
||||||
ev_pop();
|
ev_pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,14 +86,8 @@ OsMouseProc(DeviceIntPtr pPointer, int what)
|
||||||
case DEVICE_INIT:
|
case DEVICE_INIT:
|
||||||
pPointer->public.on = FALSE;
|
pPointer->public.on = FALSE;
|
||||||
|
|
||||||
map[1] = 1;
|
for (ret = 0; ret <= 8; ret++)
|
||||||
map[2] = 2;
|
map[ret] = ret;
|
||||||
map[3] = 3;
|
|
||||||
map[4] = 7;
|
|
||||||
map[5] = 8;
|
|
||||||
map[6] = 6;
|
|
||||||
map[7] = 4;
|
|
||||||
map[8] = 5;
|
|
||||||
|
|
||||||
InitPointerDeviceStruct((DevicePtr)pPointer, map, 8,
|
InitPointerDeviceStruct((DevicePtr)pPointer, map, 8,
|
||||||
miPointerGetMotionEvents, pMse->Ctrl,
|
miPointerGetMotionEvents, pMse->Ctrl,
|
||||||
|
|
|
@ -287,15 +287,12 @@ XqSignalHandler (int signo)
|
||||||
|
|
||||||
case XQ_WHEEL:
|
case XQ_WHEEL:
|
||||||
if (pMse) {
|
if (pMse) {
|
||||||
int wbut = pMse->lastButtons;
|
int wbut = pMse->lastButtons, dz;
|
||||||
if (xqEvents[xqHead].xq_code == 1)
|
if (xqEvents[xqHead].xq_code == 1)
|
||||||
wbut |= 0x80;
|
dz = 1;
|
||||||
else
|
else
|
||||||
wbut |= 0x40;
|
dz = -1;
|
||||||
pMse->PostEvent(xqMouse, wbut, 0, 0, 0, 0);
|
pMse->PostEvent(xqMouse, wbut, 0, 0, dz, 0);
|
||||||
/* Simulate button release */
|
|
||||||
wbut &= ~0xc0;
|
|
||||||
pMse->PostEvent(xqMouse, wbut, 0, 0, 0, 0);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user