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?);
  •   @aaronbjork feedback reported by customers via the chrome extension, can that be put into a specific iteration path…
  •   RT @Experts_Live: Be there 👉 #AzureDevOps Day op 20 nov. in Utrecht. Alle info vind je nu online: #communityevent #…
  •   @donasarkar MYOD
  •   @EngstromJimmy azure service bus and have something listen to azure service bus (no need to open ports for that)
  •   @BNRBarbara bij data structuren heb je het ook vaak over algoritme. bubble sort is dan vaak eerste algoritme om te…
  •   @kunalranglani @cschleiden @tfsbuck great. HTML is great improvement compared before; having same options about men…
  •   @BNRBarbara @freeCodeCamp Buble sort al gemaakt?
  •   @chrisrpatterson Hero ❤️
  •   @chrisrpatterson thanks! i am out of ideas what is going wrong
  •   @chrisrpatterson since yesterday evening (9pm utc) my yaml builds are failing because authorization issue (been wor…