G'day all,
Maiden post. Please be gentle..
I had a problem using wine with a touchscreen under XFree 4.0.2. With the help of Gerard Patel and Ove Kaaven I have come up with a patch that solves my problem, and does not appear to disrupt any of the other machines and programs I use. I have looked at several ways of achieving this, and this seems to be the least messy.
This has been tested with both the touchscreen and also ps/2 mouse and works well with both.
I'm not a C programmer at all, and have little experience with the WINE code. All comments both positive and negative appreciated.. Thanks..
To be applied to windows/input.c
--- input.c Wed Aug 29 21:00:42 2001 +++ input.c.new Wed Aug 29 20:59:01 2001 @@ -195,43 +195,43 @@ if (mi->dwFlags & (!SwappedButtons? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_RIGHTDOWN)) { MouseButtonsStates[0] = AsyncMouseButtonsStates[0] = TRUE; - queue_raw_hardware_message( WM_LBUTTONDOWN, keystate, 0, PosX, PosY, + queue_raw_hardware_message( WM_LBUTTONDOWN, keystate, 0, mi->dx, mi->dy, mi->time, mi->dwExtraInfo ); } if (mi->dwFlags & (!SwappedButtons? MOUSEEVENTF_LEFTUP : MOUSEEVENTF_RIGHTUP)) { MouseButtonsStates[0] = FALSE; - queue_raw_hardware_message( WM_LBUTTONUP, keystate, 0, PosX, PosY, + queue_raw_hardware_message( WM_LBUTTONUP, keystate, 0, mi->dx, mi->dy, mi->time, mi->dwExtraInfo ); } if (mi->dwFlags & (!SwappedButtons? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_LEFTDOWN)) { MouseButtonsStates[2] = AsyncMouseButtonsStates[2] = TRUE; - queue_raw_hardware_message( WM_RBUTTONDOWN, keystate, 0, PosX, PosY, + queue_raw_hardware_message( WM_RBUTTONDOWN, keystate, 0, mi->dx, mi->dy, mi->time, mi->dwExtraInfo ); } if (mi->dwFlags & (!SwappedButtons? MOUSEEVENTF_RIGHTUP : MOUSEEVENTF_LEFTUP)) { MouseButtonsStates[2] = FALSE; - queue_raw_hardware_message( WM_RBUTTONUP, keystate, 0, PosX, PosY, + queue_raw_hardware_message( WM_RBUTTONUP, keystate, 0, mi->dx, mi->dy, mi->time, mi->dwExtraInfo ); } if (mi->dwFlags & MOUSEEVENTF_MIDDLEDOWN) { MouseButtonsStates[1] = AsyncMouseButtonsStates[1] = TRUE; - queue_raw_hardware_message( WM_MBUTTONDOWN, keystate, 0, PosX, PosY, + queue_raw_hardware_message( WM_MBUTTONDOWN, keystate, 0, mi->dx, mi->dy, mi->time, mi->dwExtraInfo ); } if (mi->dwFlags & MOUSEEVENTF_MIDDLEUP) { MouseButtonsStates[1] = FALSE; - queue_raw_hardware_message( WM_MBUTTONUP, keystate, 0, PosX, PosY, + queue_raw_hardware_message( WM_MBUTTONUP, keystate, 0, mi->dx, mi->dy, mi->time, mi->dwExtraInfo ); } if (mi->dwFlags & MOUSEEVENTF_WHEEL) { queue_raw_hardware_message( WM_MOUSEWHEEL, MAKELONG( keystate, mi->mouseData), 0, - PosX, PosY, mi->time, mi->dwExtraInfo ); + mi->dx, mi->dy, mi->time, mi->dwExtraInfo ); } }
Brad Campbell wrote:
G'day all,
Maiden post. Please be gentle..
I had a problem using wine with a touchscreen under XFree 4.0.2. With the help of Gerard Patel and Ove Kaaven I have come up with a patch that solves my problem, and does not appear to disrupt any of the other machines and programs I use. I have looked at several ways of achieving this, and this seems to be the least messy.
This has been tested with both the touchscreen and also ps/2 mouse and works well with both.
I'm not a C programmer at all, and have little experience with the WINE code. All comments both positive and negative appreciated.. Thanks..
This is probably a more correct patch as it only changes the Pos variables when it's a buttonpress and the absolute flag is set. Because the message in event.c that sends this refers to the getcoords function for it's position data, then the position data is guaranteed to be absolute thus I added the absolute flag to the message sent, this should not affect anything else.. You will have to excuse the logic in input.c as I'm working from a beginners guide to C. I'm a PASCAL programmer by nature..
Thanks for any input..
--- windows/input.c.orig Wed Aug 29 22:44:47 2001 +++ windows/input.c Thu Aug 30 15:13:08 2001 @@ -187,6 +187,12 @@ } }
+ if (!(mi->dwFlags & MOUSEEVENTF_MOVE) && (mi->dwFlags & MOUSEEVENTF_ABSOLUTE)) + { + PosX = mi->dx; + PosY = mi->dy; + } + if (mi->dwFlags & MOUSEEVENTF_MOVE) { queue_raw_hardware_message( WM_MOUSEMOVE, keystate, 0, PosX, PosY,
--- windows/x11drv/event.c.orig Thu Aug 30 15:14:28 2001 +++ windows/x11drv/event.c Thu Aug 30 14:52:15 2001 @@ -477,7 +477,7 @@ break; }
- X11DRV_SendEvent( statusCodes[buttonNum], pt.x, pt.y, + X11DRV_SendEvent( statusCodes[buttonNum] | MOUSEEVENTF_ABSOLUTE, pt.x, pt.y, keystate, wData, event->time - X11DRV_server_startticks, hWnd); }