I don’t know max, so I don’t know if I have correctly got what you’re asking, but vvvv features Keyboard (Devices Desktop) and Keyboard (Devices Window). Open their help patches to get an useful overview of their functions. Have a look at the girlpower links in those help patches, too. You can then patch some logic to manage video switching and the rest.