Sets the barrel buttons on the Wacom bamboo pen for surface devices. The front button is undo, while the back is redo while hovering the pen above the screen. This script will also work with the surface pen, but will only allow for the undo function as that pen only has one button.
Make sure to install AutoHotKey: https://www.autohotkey.com/ And download a copy of AHKHID.ahk in the same folder that you keep this script in: https://github.com/jleb/AHKHID
This script can be easily modified, just scroll down to "This is where we remap the side button to the Copy/Paste events" and add or modify any commands you like.