I've seen a few posts about giving extra functions to mouse buttons by holding or double clicking them, so I decided to adapt a script I had made into a function to allow assigning subroutines to these events.
This function works with any button and keeps the original one-click and drag functions of the button. It should also work with combinations.
MouseExtras.ahk
Download from GitHub (Right-Click > Save As)
Spoiler
Example:
Spoiler