I’m writing a script that (when the enter button is pressed) requires some user input (and I’m just using the raw data input method for now). But I would like to program to automatically switch focus from the game window to the cmd prompt window and vice versa when the enter button is pressed so the user doesn’t have to manually keep clicking back and forth when entering information and playing the game.
Thanks!
You can use
SendKeysto send an alt tab command to the game to switch between the two, like so:or you could use Mark Hammond’s pywin32 stuff and set the ActiveWindow (or something similar) to the game or the prompt, depending.