I am using the InjectTouchInput()
API on Windows 10 to inject touch events from a separate digitiser. That works well (multi-touch etc.). There are quite a few examples out there of using the API for that, i.e. using a pointer type of PT_TOUCH
, including one from Microsoft, so it wasn't too difficult to customise them to my needs.
However, I have not found any example of using other pointer types, especially PT_PEN
- which I need when the digitiser gives me pen inputs. (I'd also be interested in PT_MOUSE
, mainly to avoid having to use SendInput()
or mouse_event()
.)
Whenever I call InjectTouchInput()
with PT_PEN
, it fails with ERROR_INVALID_PARAMETER
. I've tried quite a few combinations of fields to set, but nothing (so far) works. The MSDN documentation doesn't describe what to do for PT_PEN
(it doesn't describe much for PT_TOUCH
, but at least there's one sample), so it's quite difficult to know what fields should be set, which ones should be ignored, any specific sequence of operations, etc. I've been scouring the net, but couldn't find any example of PT_PEN
use.
Does anybody have sample code or know where to find any, knowledge of where useful documentation is located, or knows how InjectTouchInput()
is supposed to be used for PT_PEN
(and PT_MOUSE
)?