How can I send keyboard input to a OpenGL/DirectX game window?
问题 How can I simulate a keypress in a game window (using any programming language in Windows)? AutoHotKeys Scripts and .NET SendKeys functions do not work... 回答1: Using AutoIt!3 (which is quite similar to AutoHotKeys), you'd use Send() (http://www.autoitscript.com/autoit3/docs/functions/Send.htm), but make sure to have the game window active ( WinActivate() ) before you do. I've used this to interact with Second Life (which uses OpenGL) succesfully. You may require a Sleep() period between