I am experimenting with WM_TOUCH and want to detect if mouse events are synthesized from touch/pen events or due to an actual mouse event.
The official solution according to MSDN is to check if the result of GetMessageExtraInfo()
has the upper 24 bits set to 0xFF515700
.
This works. Most of the time. If I use one finger, all is well and good, but if I use more than one, releasing the last one causes a mouse move with GetMessageExtraInfo() == 0
. Also, when the window loses focus via touch, up to 3 mouse move messages with GetMessageExtraInfo() == 0
are generated.
Is there a reliable way of disambiguating between mouse, touch and pen inputs?
See Question&Answers more detail:os