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?);
  •   @mahoekst @onovotny windows store ftw; easily get rid of the tool afterwards
  •   @mahoekst C
  •   @andrewclinick less or more bugs :P
  •   @NorthFaceHiker what is blocking mobile currently? *just curious)
  •   RT @aafvstam: "Bouw je eerste Hololens app" with Dave Smits and Guido Kersten #SDNEvent
  •   @hermitdave i found it too complicated to keep supporting older versions. only support the current one
  •   @aaronbjork @DonovanBrown @venky_venky76v i get a lot of requests for my widget (activity feed) to have a view over multiple projects.
  •   RT @Pureinfotech: Microsoft begins promoting the Windows 10 Creators Update with update KB4013429!
  •   @microsoftnl heb um al! :D
  •   New Windows SDK drop: