Im using win32 touchinjection on windows 10 desktop.
I have been trying for two days to get pen simulation.
The code below works with PointerInputType.Touch but i need pressure and orientation, which don't seem to work.
GetLastError() returns 87 which means bad parameter but i have tried every pair of parameters i can think of.
InitializeTouchInjection();
pointer = new PointerTouchInfo();
pointer.PointerInfo.PointerId = 1;
pointer.PointerInfo.pointerType = PointerInputType.PEN;
pointer.TouchMasks = TouchMask.PRESSURE | TouchMask.ORIENTATION;
// pointer.TouchMasks = TouchMask.CONTACTAREA | TouchMask.ORIENTATION | TouchMask.PRESSURE;
pointer.Pressure = 1024;
pointer.Orientation = 90;
// pointer.PointerInfo.PtHimetricLocation.X = 50;
// pointer.PointerInfo.PtHimetricLocation.Y = 200;
pointer.PointerInfo.PtPixelLocation.X = 50;
pointer.PointerInfo.PtPixelLocation.Y = 200;
pointer.PointerInfo.PointerFlags = PointerFlags.INCONTACT |PointerFlags.INRANGE| PointerFlags.DOWN;
var a1=InjectTouchInput(1, new[] { pointer });
var b1 = GetLastError();
int errCode = Marshal.GetLastWin32Error();
Any information on how i could get this working or debug this further would be greatly appreciated.