Execute different scripts on key down and key up?

I'm trying to setup a shortcut key to have a push-to-mute setup for my calls. I can setup a shortcut to toggle the input volume (setup caps lock presently as I can see the light to know the status) however that always requires two clicks, one to mute and one to get back. For shorter muting, like when coughing or sneezing, I'm trying to have a setup where I push a button (ideally capslock but any single button should work) and it executes a script to mute the mic but when I let the button go, another script unmutes the mic.

Is it possible to do in BTT?

This should be possible by configuring the shortcut twice, one with the mute script one with unmute and using the options here:

1 Like

Oh great! I didn't think of creating two triggers. And is never I was using a single caps lock key, I had to use the key sequence. Btw I noticed that in the record sequence dialog, fn key only records the key down and never a key up, the other modifier keys all record both. Is that a limitation of MacOS or is it my setting in system pref to show quick actions on fn conflicting perhaps? I'll check tomorrow on the computer.

On my MBP keyboard it seems to record the up and down:

Oh sorry. I got confused. It's the caps lock key actually. Even when I am holding it down, it shows Modifier Up only.