How can I send or replicate/ "emulate" mouse and keyboard clicks in both windows?

Basically I want to multibox a game but it has no /follow macros of any sorts. Its literally point and click+2-4 keyboard binds hack n slash rpg. I need to input broadcast.

I bought 2 wireless keyboards/mice to try to replicate it but due to lag the mice go out of synch and it all fails. With sandboxie i can stack up both game windows perfectly in synch with each other. But I cannot seem to export any commands or send output to an inactive window into sandboxie(that I do outside of it) So I was wondering is there a way to setup those mice/keyboards into sandboxie? When i try to plugin both the wireless recievers the hardware wants me to only use one.

I saw a text app and few others doing the same thing in sandboxed environment, so i am wondering, if someone help me to figure out, that how aText.app and others are able to send keystrokes in sandbox environment.