Create a new macro and set the trigger for it to be USB Device Key Trigger
The macro will then look like this
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.
This won't run automatically on track selection (KM doesn't have a trigger for that), but it will run different actions depending on the selected track's name.
Further to the above, you may be able to cobble something together that works with mouse clicks, as @tiffle suggested, but it would be necessarily complex and could create more problems than it solves.
What is the nature of the kind of macro you'd like to run upon track selection? For all we know, this might be an XY problem.
Hi @noisneil - I just so happened to have downloaded a trial of Cubase and there isn't a menu command to rename the first selected track - that I could find anyway.
However, under the Edit menu there's a Key Commands option that lets you assign a keyboard shortcut for that command - but even when you've done that it is only accessible via the keyboard shortcut you've set up. So your macro would work if you replace the Select Menu action with a type keystroke action such as
The track names in the macro are taken from one of the demo projects supplied with Cubase; you'll need to change these to reflect your own track names.
On a slow Mac, you might need to enable the two Pause actions.