I got a complaint, albeit a very friendly and not “complainy” one, that the Linkage software isn’t handling the pen (stylus) on a Windows tablet properly. I implemented pen-to-mouse conversion code that seems to be working.

HP Stylus/Pen with Two Buttons on the Barrel

My HP Spectre x360 came with a stylus so I was able to test my new software. Since the stylus has two button on the shaft and no erase “button” on the back, I assumed that one of the two buttons is the erase button and the other is the generic button that other devices have by itself.

The Windows pen messaging is weird because some pen messages get converted to mouse messages. A pen-down message gets translated to a mouse-left-button-down message. But when the button is pressed, that doesn’t cause right-button mouse messages for some really odd reason. The reason seems to be so that old software just breaks if someone is using a pen ;) I added my own message translation/conversion that check the pen messages to detect when the button is pressed and I then generate the appropriate right-button mouse messages. By doing this translation, my older mouse handling code doesn’t need to change. And in reality, the only thing that makes this “mouse” code is the fact that the function names have “mouse” in them. The functional code doesn’t know or care if the right-button-down message came from a mouse, a pen, or a finger. The original system designers lacked imagination or they would have otherwise gave the messages names like “pointing device primary button down” instead of what they did with the word “mouse” in all of their OS code.

The pen-capable version of the Linkage software is here: https://www.rectorsquid.com/alpha/linkage.msi

Please report any bugs if you test this.