有没有办法在Windows 8中模拟触摸事件

Jim*_*röm 11 c# touch windows-7 windows-8

有没有办法模拟Windows 8中的触摸事件(最好是在Windows 7中).
我知道有一个名为Multi touch vista的项目,但我觉得它有点矫枉过正,我从来没有让它在多个屏幕上正常工作.
我想要做的非常简单,我想启动一个可以向Windows发送触摸事件的应用程序,不需要多个鼠标或任何类似的东西.
它可以完成还是我需要一个(MMV)驱动程序来做到这一点?

谢谢
/吉米

ala*_*ala 5

我正在寻找类似的东西,并发现这篇文章使用Touch Injection API示例代码(C++)在Windows Developer预览中模拟触摸输入可能会回答您的问题.但是,这似乎仅适用于Windows 8(不是Windows 7).

它模拟点击,保持,拖动,捏/平移,旋转和交叉滑动.

这是触摸(Tap)代码:

POINTER_TOUCH_INFO contact;
InitializeTouchInjection(1, TOUCH_FEEDBACK_DEFAULT); // Here number of contact point is declared as 1.
memset(&contact, 0, sizeof(POINTER_TOUCH_INFO)); 

contact.pointerInfo.pointerType = PT_TOUCH;
contact.pointerInfo.pointerId = 0;          //contact 0
contact.pointerInfo.ptPixelLocation.y = 200; // Y co-ordinate of touch on screen
contact.pointerInfo.ptPixelLocation.x = 300; // X co-ordinate of touch on screen

contact.touchFlags = TOUCH_FLAG_NONE;
contact.touchMask = TOUCH_MASK_CONTACTAREA | TOUCH_MASK_ORIENTATION | TOUCH_MASK_PRESSURE;
contact.orientation = 90; // Orientation of 90 means touching perpendicular to screen.
contact.pressure = 32000; 

// defining contact area (I have taken area of 4 x 4 pixel)
contact.rcContact.top = contact.pointerInfo.ptPixelLocation.y - 2;
contact.rcContact.bottom = contact.pointerInfo.ptPixelLocation.y + 2;
contact.rcContact.left = contact.pointerInfo.ptPixelLocation.x  - 2;
contact.rcContact.right = contact.pointerInfo.ptPixelLocation.x  + 2;


contact.pointerInfo.pointerFlags = POINTER_FLAG_DOWN | POINTER_FLAG_INRANGE | POINTER_FLAG_INCONTACT;
InjectTouchInput(1, &contact); // Injecting the touch down on screen

contact.pointerInfo.pointerFlags = POINTER_FLAG_UP;
InjectTouchInput(1, &contact); // Injecting the touch Up from screen
Run Code Online (Sandbox Code Playgroud)

另一篇文章:Windows Touch Gestures入门