How can I create a separate trigger for clicking vs holding a mouse button?

I'd like for a single click on button 4 on my mouse to go back a page, but holding button 4 to change tabs. Is this possible to trigger with some combo of mouse up/down and delays or something?

I'm also trying to do something similar myself. I'd love to be able to differentiate between mouse button click and mouse button hold.