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?);
  •   @fonssonnemans @mahoekst start calc and try
  •   @fonssonnemans @mahoekst or better: -1.068281968439142x10^-19
  •   @mahoekst @fonssonnemans hahahaha +1
  •   @fonssonnemans does it solve wortel(4) -2 correctly? if so it's nice for @Windows to fix the calculator
  •   @LocalJoost ik zat op de dag naar techdays naar kerst muziek te luisteren op de auto radio
  •   RT @edblankenship: New on VSTS: Follow a PR, task versioning, and search for commits in branches – Nov 23 https://t…
  •   RT @windowsblog: Windows Ink 3: Beyond Doodling
  •   @oudendorp Spent time in training the user about security
  •   @oudendorp i dont think this should be solved by IT... shadow IT happens when admins lockdown everything.. make sure people can work.
  •   @alexmullans @tfsbuck thanks.. Seems we got it fixed. Was issue with another account