tap vs press and hold

tap vs press and hold

Hello, is it possible to make a button do different actions depending on whether the button is held or tapped?

for example I want mouse 4 to have its default use when quickly pressed but when pressed and held it would be a key stroke (ALT in my case). 

Thanks.