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?);
  •   @JenMsft like the concept. but too much details to go now. disabled it
  •   RT @dotMorten: I am an Edge user, but forcing users of Windows Mail to use Edge might be the most evil thing Microsoft have done in a long…
  •   @donasarkar impressive!
  •   RT @PyImageSearch: I am excited to announce that @Microsoft + @MSFTResearch are sponsoring PyImageConf 2018 and providing FREE pre-configur…
  •   @tfsbuck thanks :)
  •   @tfsbuck never mind.. figured it out, well the creator of the PR was able to restart the merge and in second attempt it worked
  •   @terrajobst @fonssonnemans @hermitdave @imjoshfree dark is for depressed people. agree with @fonssonnemans light team ftw
  •   @tfsbuck how long should it take to complete a pull request? can that take over 15 minutes? normally pretty fast (i mean instant)
  •   RT @windowsblog: Windows 10 SDK Preview Build 17115 now available
  •   RT @csharpfritz: Visual Studio 2017 Version 15.7 Preview 1