Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I was looking for something similar and found this article <a href="http://social.technet.microsoft.com/wiki/contents/articles/6460.simulating-touch-input-in-windows-developer-preview-using-touch-injection-api-en-us.aspx?PageIndex=2">Simulating Touch Input in Windows Developer preview using Touch Injection API</a> and <a href="http://code.msdn.microsoft.com/windowsdesktop/Touch-Injection-Sample-444d9bf7">sample code</a> (C++) may answer your question. However, this seems to work only on Windows 8 (not Windows 7).</p> <p>It simulates Tap, Hold, Drag, Pinch/Pan, Rotate and Cross-Slide.</p> <p>Here is the touch (Tap) code:</p> <pre><code>POINTER_TOUCH_INFO contact; InitializeTouchInjection(1, TOUCH_FEEDBACK_DEFAULT); // Here number of contact point is declared as 1. memset(&amp;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, &amp;contact); // Injecting the touch down on screen contact.pointerInfo.pointerFlags = POINTER_FLAG_UP; InjectTouchInput(1, &amp;contact); // Injecting the touch Up from screen </code></pre> <p>Another article: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd371578%28v=vs.85%29.aspx">Getting Started with Windows Touch Gestures</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload