Microsoft Ink Pen / Stylus as Input Device

We’re currently working on a project designed for big touchscreens, these screens come with a Microsoft Ink-like Pen / Stylus which is used to draw and write.

The problem is that Unity does not seem to support a Pen / Stylus as input device. For instance, it does detect the position of the Pen / Stylus in Input.mousePosition, even when hovering over the touchscreen but it does not detect a down event when pressure is applied to the Pen / Stylus tip.

When the “Ignore touch input when I’m using my pen” setting in the Windows Settings (Settings > Pen & Windows Ink) is disabled it’ll detect the Pen / Stylus as a regular touch besides that this is not the behaviour we want it also does not provide the Pressure value we need to calculate the stroke thickness.

I’ve been told that this should work when making an UWP build but we also have provide Standalone Windows builds.

We’ve searched and attempted numerous approaches to get Pen / Stylus input to work but without much success.

Has anyone attempted this before? Can someone point us in the right direction?

Does this silence mean nobody has attempted to incorporate Microsoft Ink-like Pen / Stylus support for a Unity project or has nobody actually succeeded?

I’m curious at this point; I can’t be the only one trying to make this work.

An update for those who could possibly find this thread in their search for the same solution I’m looking for:

We came across the uWintab plugin (GitHub - hecomi/uWintab: Wintab API plugin for Unity) made by Hecomi, which we’re currently using for our Windows Standalone builds. For UWP builds we had to find another solution because the plugin does not work in a UWP build.

The solution that we implemented for UWP at the moment is the WinRT Asset (https://www.assetstore.unity3d.com/en/#!/content/84593) from the Asset Store. After building a UWP project in Unity we edit it to overlay an Ink canvas and add PointerEvents. We then send the data from these PointerEvents to Unity with the asset.

1 Like

I have a xp-pen star g430 graphics tablet without screen ,Windows Ink and XP-Pen drivers play nice together . it has pen pressure in unity .

T

hanks!