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?);
  •   @mtaulty with performance base? I am soo in love with battery
  •   @SlackHQ @dotMorten #uwp ftw.. Win32 should be illegal
  •   RT @jaimerodriguez: Must read for #hololens developers.. A detailed overview of the spatial understanding apis in #HoloToolkit https://t.…
  •   @Schiphol i want to come to schiphol with a GA plane. what is the cheapest handling party?
  •   RT @windowsblog: ICYMI: Get ready for WinHEC 2016
  •   @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