"Hold Down" Secondary function touchbar button

Hello!
I have a touch bar button that opens a group of folders and apps. I'm wondering if its possible to add a secondary feature to the button where if i hold it down for say 1 second instead of tapping it, it will hide hide all open apps/windows. Is this possible?

thanks in advance :slight_smile: