Everyone,
I am working on scripting AutoKey for a game I play. The use case is this: I have two instances of the game running. On one, I have my main character. On another, I have a secondary character which supports the main (heals, etc). I have managed to create a script that when executed will cause the main character to execution an action, switch to the secondary char's window, and cause it to do something different, then switch focus back to the main character's window. However, this means a lot of focus switching between windows, which is not ideal. Ideally, I would prefer to simply send commands to the backgrounded alternate character's window without switching focus.
I am just learning Python (to script AutoKey), but feel comfortable with that part of it as I have learned quite a few languages and pick up on programming languages easily. But before I got too in depth with this, I thought I'd give a shout out to see if anyone had attempted anything like this before. While Python itself seems pretty easy to learn, the Python X library is a bit daunting and I think I will need something like keyboard.fake_keypress, only sending it to another window rather than the root window. Any advice would be appreciated.
Thanks,
Philip A. Chapman