The first answer you’re going to get is that you can’t do that and it would ALMOST be right.
There is a conditional branch available in the macro api.
/click [condition]ButtonFrameName
So, this…
/click [mod:alt]ButtonFrame1
/click [mod:ctrl]ButtonFrame2
/click [mod:shift]ButtonFrame3
/click [nomod]ButtonFrame4
…allows you to place a macro on Button1 that you can be certain will only be activated when you have the alt key down (assuming you don’t actually press Button1 yourself), to place a macro on Button2 that you can be certain will only be activated when you have the control key down, to place a macro on Button3 that will only be activated when you have the shift key down, and to place a macro on Button4 that will only be activated when you have none of them down.
You can put ANY valid condition or set of conditions in there. You can chain them together in a single line like this:
/click [mod:alt]ButtonFrame1;[mod:ctrl]ButtonFrame2;[mod:shift]ButtonFrame3;ButtonFrame4
Note that I was able to remove the “nomod” condition on the last one that way and got rid of a lot of characters by not duplicating "/click " unnecessarily.
This is a very powerful mechanism and I use it for managing my targeting and controlling my pets for every targeted attack on my hunter (I manage growl and misdirection, always have a current target, allow for retargeting, allow for situaitonal priority targets, and a few more things).
I have a short treatise on this as a free download on my Patreon page (no contributions are being accepted - this is just a legitimate place to house the file).
You can get to it here:
www.patreon.com/KaldaraWorks
If you have question, please feel free to ask.
I will tell you that there are a (very) few minor issues with how those macros are constructed (I’ve improved them since I wrote that). But the concepts are sound.