Followed by returning to the previous window? Thats how I have Keyboard Maestro acting as a Generic Remote, and also for using the keyboard to scroll horizontally in Score Edit View.
I think it is a bit involved to get Autohotkey to send midi commands, but that might just be because I don’t know anything about how Windows Midi works.
The project window has it’s own KC in Cubase, which does work “right”.
I also use it for the setting and other windows in Score Edit.
Anyhoo, have a look at the macro in Quickeys, it is fairly self-explanatory.
But basically it’s like this:
IF
window containing in title “Mix” exists
switch to it
ELSE
Open it.
AutoHotkey is excellent. I wish I knew of an equivalent for Mac.