How to Trigger a Macro by Channel Selection in Cubase 12?

Create a new macro and set the trigger for it to be USB Device Key Trigger
2023-03-03_10-00-43

The macro will then look like this
2023-03-03_10-01-38

Then just click your mouse button to enter it into the trigger field.

I can't test this myself since I have a Magic Trackpad, but a quick search of this forum leads me to believe it should allow you to trigger with a mouse click as required. Your macro will then have to determine what it is that you've actually clicked on and that might be a bit tricky to work out.