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?);
    }
} 
  •   @onovotny @Nick_Craver @andygocke @davkean @VisualStudio Use git worktree instead cloning again?
  •   @tfsbuck Congrats
  •   @donasarkar updating :)
  •   RT @tfsbuck: The VSTS Activity Feed extension gives a summary of all recent changes of work items, commits, pull requests and builds. It te…
  •   @davkean @lifeng_lu here you are: https://t.co/zeab4UpLyy
  •   @davkean @lifeng_lu On it way! just happend again
  •   @davkean intermittent; but ones it started i stays the rest of the session that way. anything i can do make a log when it happens?
  •   @davkean yes. now happens often i need to toggle hide/show all files in the solution explorer to ensure the project… https://t.co/xqZlVb6Qbx
  •   @davkean branch switching and make sure the project system understands when new files are added / removed
  •   RT @VSTS: Power BI and VSTS - integration made easy. Our new feature Analytics views makes getting VSTS work tracking data into Power BI s…