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?);
    }
} 
  •   having a fun afternoon with #fluent and #rome ; let see if can make something publishable
  •   RT @pag3rd: If you'll be at #MSIgnite and want to learn about what's new with #XAML #FluentDesign and the brand new #WinUI library come to…
  •   RT @kevintgallo: What’s your favorite color? https://t.co/GvhJIb4ItX
  •   @shanselman @tomasrestrepo @h0x0d @joncaves does it mean @satyanadella holds the mic for you next time at build?
  •   @BNR De eindstand (aangekomen op bestemming) https://t.co/DXxHPP57iy
  •   Toch even aan die conditie werken.. Je weet maar nooit @bnr #fiemibo https://t.co/H61vOPrtVi
  •   RT @donasarkar: Hello #WindowsInsiders we have released 19H1 Build 18242 to Skip Ahead! https://t.co/kuo5Y9jt0i
  •   @BNR Zines de 2 jaar dat ik bij bnr heb gewerkt 😊 #ikhoorbijbnr
  •   @JenMsft is there a way to get notfication mirring from android to win desktop without the cortana app (its not available in netherlands)
  •   @tomverhoeff @bartlannoeye i agree with bart in this.. been seeing enough 'good speakers' just delivering 101 sessions all the time