Pen identity in UWP

When you are building apps for the Surface Hub you can use a real cool inking feature. The screen is already amazing with 84" and the pen support. But the pens also have an identity. This is a number and when you match this up with a credential you can do awesome things.

To get the pen identity you need few simple lines of code. I build an extension method for that:

public static class PointerPointPropertiesExtensions
    private const uint WirelessIdUsagePage = 0x0D;
    private const uint WirelessIdUsage = 0x5B;

    public static int? GetPenId(this PointerPointProperties pointerProperties)
        var hasId = pointerProperties.HasUsage(WirelessIdUsagePage, WirelessIdUsage);
        return hasId ? pointerProperties.GetUsageValue(WirelessIdUsagePage, WirelessIdUsage) : default(int?);
  •   RT @CameronLerum: MAT v4.0 for VS 2017 RC is available via the Extension and Update UI.
  •   @DonovanBrown setting up CI for core created with latest visual studio 2017 rc. Supported on hosted build server?
  •   @tfsbuck do you know a blog post about CI for .net core with latest tooling? the ootb template still uses project.json
  •   @JenMsft make me never going back to OWA (and not even outlook installed)
  •   @JenMsft already got those features online and on my machine that is in the fast ring. Love it sooo much. Skype meeting + schedule assist
  •   @JenMsft when is this coming to non insiders?
  •   RT @windowsblog: Announcing updates to #Windows10 Mail & Calendar apps
  •   @LocalJoost europe is that tiny island on the east of them that is not big enough to make their products available
  •   @mahoekst we love to hear so twitter ahead!
  •   @LocalJoost got one here too, wondering why the touchscreen is soon small