[Lazarus] Windows touch input

R0b0t1 r030t1 at gmail.com
Sun Jan 21 22:33:01 CET 2018


Hello friend,

2018-01-21 13:36 GMT-06:00 AlexeyT via Lazarus <lazarus at lists.lazarus-ide.org>:
> How does Laz support touch input [e.g. on Surface from MS]. Where to read
> about it in wiki?
>

For most input, touch events are turned into mouse events. The most
basic events are WM_GESTURE[1] (received by default) and WM_TOUCH[2]
(opt-in) messages. WM_TOUCH will receive pen events. You may also
access these events using raw input and the WM_INPUT message, though
details on this are not as forthcoming.

However, from Windows 8 onward, there is a pointer API which unifies
pointer (generic), touch, pen, mouse, and touchpad input. Look at the
WM_POINTER*[3] messages for more details. The most control is granted
with this API, and you can, for example, get the pressure of the pen
on the screen as well as its pitch, roll, and yaw relative to the
screen.

You might also be interested in stylus/pen input, but it is much more
complicated.[4] If you wish to use another writing recognition
library, or do not need one, then you should be able to access these
events via WM_TOUCH, WM_POINTER*, or WM_INPUT. There is also a COM
object called a RealTimeStylus.[5]

Cheers,
     R0b0t1

[1]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd353242(v=vs.85).aspx
[2]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd317341(v=vs.85).aspx
[3]: https://msdn.microsoft.com/en-us/library/windows/desktop/hh454903(v=vs.85).aspx
[4]: https://msdn.microsoft.com/en-us/library/windows/desktop/ms704172(v=vs.85).aspx
[5]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd940549(v=vs.85).aspx


More information about the Lazarus mailing list