Using AutoHotkey with Surface Pen

https://autohotkey.com/

This is a scripting language designed for Windows to automate some usage. A lot can be accomplished by re-mapping the inputs.
While Windows 10 does allow apps to be loaded by the surface pen, however, these can be messed up and are very limited. What if the pen’s single click was “Copy” and the double-click was “Paste”? Something like this is easily achieved with AutoHotkey.

1
2
; remap surface pen button to copy to clip-board
#F20::^z

Simple mappings can be achieved with short-syntax, however the surface pen tends to have some problems with this when turing off the hotkeys. More success can be had by using the full syntax and applying the down and off state.

1
2
3
#F20::Run Onenote ; Single click, Open OneNote
#F19::Send, {Shift down}{LWin down}s{Shift up}{LWin up} ; Double click, Take a screenshot into onenote (hotkey created by onenote)
#F18::Send, {Control down}{Shift down}{Alt down}x{Control up}{Shift up}{Alt up} ; Hold button to trigger snippet tool (hotkey created within Windows)

This is the beginning of using AutoHotkey. It’s been around for many years and has thousands of options that can be scripted including mouse moving and deep Windows interactions. Check out https://github.com/dantheuber/WinTop-AutoHotKey for one of my favorite ways to keep a window on top with a transparency.