How to program in Delphi for Microsoft Surface Pen?

I would like to integrate the features of a surface pen in my application. This is written using the Delphi 10 Seattle. I searched the net and found nothing.

Does anyone know how to program a pen? In particular, to capture the level of pressure, pen, pen and pen movement of the event.

+5
source share
1 answer

Your application must process the WM_POINTERUPDATE message.

During this message, you can call GetPointerPenInfo to get information about the current status of the pointer as POINTER_PEN_INFO Structure :

 POINTER_PEN_INFO = record pointerInfo: POINTER_INFO; penFlags: PEN_FLAGS; penMask: PEN_MASK; pressure: UINT32; rotation UINT32; tiltX: INT32; tiltY: INT32; end; 
+1
source

Source: https://habr.com/ru/post/1241949/


All Articles