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?);
  •   @tfsbuck awesome work
  •   RT @tfsbuck: VSTS Queries Hub Updates Generally Available
  •   RT @danvy: From Monolith to Cloud Service by @tfsbuck #devops #cloud
  •   @JenMsft it almost want me to start playing computer games
  •   opening @Office365 admin center causes @MicrosoftEdge to reload till it says " This page is having a problem loading"
  •   @DonovanBrown @VSTS i love to them as well but missing test results in the release overview pretty much
  •   RT @ExpertsLiveNL: ICYM 📣 HURRY UP: grijp die laatste kaart(en) #ExpertsLiveNL is BIJNA uitverkocht. #nog7dagen #a…
  •   @rrelyea any idea why nuget via dotnet restore on linux build agents (vsts) takes 40seconds and via nuget restore o…
  •   @tfsbuck in a build task i am trying to give a summary for the build detail page but need some richer markup then m…
  •   @chrisrpatterson @Nick_Craver @tfsbuck really curious to the outcome; we use a Azure Sql db (create new one for tes…