Stylus Input

Hi all,

I’m trying to figure out a way to get stylus/pen input in a monogame windows application. The Win32 C API seems to offer these as system messages, but all the C# information I’ve found seems to be pushing WPF’s InkCanvas.

Anyone have any thoughts on how to get the stylus/pressure/etc. information?

Thanks!

I’ve never done touch in MG, but can’t you just use TouchPanel?

I would aim to use UWP for that…

Using a pen or stylus is just like touching with a thin/little finger IMO.
As Jjagg proposed, regular Touch should do the same.

Thanks all - TouchPanel does capture the position input from a stylus - it’s just missing the pressure data. Going to dig a little deeper and see if I can figure out why.

One last update - if anyone’s interested.

Pressure is not being captured in touch panel events for windows applications (in fact the comments suggest that this is only available on android atm). A windows client could potentially grab the pressure info using Win32’s GetPointerPenInfo call, but the actual device ID required isn’t exposed by the framework.

Win32 also makes a distinction between touch and pen when it comes to pressure, so there’s a bit of extra logic that would have to happen if both were to use the same TouchPanel interface.

I suppose this is in reference to Windows 7 and older…

Yes, this would apply to non UWP windows games. Just jumping into UWP now to see if there’s an easier path - thanks for the advice!

1 Like