I've been trying various things for a year. I am a at beginner's level in python. Did the first two questions in Project Euler.
I have tried a few methods to try and simulate keys in games I play. I can easily do this with autohotkey and macro keyboards/mouse. However, I would like to accomplish this through Python or C.
My guess is that win32 api is ignored in video games and I need to simulate key presses through Direct X.
Thank you in advance. Here is my latest attempt... it failed.
I do have to grab/change the handle every time I run a new instance of the game.
My simulated keys would work in the browser and notepad, just not in game. By not working, I mean there is no user input.
The following code would switch to the window but will not simulate an input from the user.
import pywinauto
import time
from pywinauto import application
app = application.Application()
app.connect_(handle = 0x14002a)
dialogs = app.windows_(handle = 0x14002a)
dlg = app.top_window_()
time.sleep(1)
app.MapleStory.TypeKeys("%A")
time.sleep(1)
app.MapleStory.TypeKeys("%A")
time.sleep(1)
app.MapleStory.TypeKeys("%A")
time.sleep(1)
app.MapleStory.TypeKeys("%A")
time.sleep(1)
app.MapleStory.TypeKeys("%A")
time.sleep(1)
app.MapleStory.TypeKeys("%A")