Can't send mouse events to the game via pyautogui and win32gui
Hi! I am not sure if this is the right place to ask, but I am not aware of any better place for this. I am trying to write Morrowind game bot using python. For python automatio pyautogui` (crossplatform) and win32gui (only Windows) libraries often used.
But unfortunately is seem that game engine ignore commands I am sending via this libraries
Simple example:
def mouse_left(hold_time):
start = time.time()
while time.time() - start < hold_time:
pyautogui.move(-1, 0)
This simple function call suppose to repeatedly move mouse to the left one pixel at a time for a given timespan,
but it works only on menu screen. If I press Esc and see main menu: Return, New, Save, Load, Options, Exit - then I can see cursor slowly moving to the left. Bu as soon as I click Return
it stops working, while I was expecting viewport turning to the left slowly.
Any advice why this is happening? Maybe there is workaround? Maybe not in python, but in C++ Thanks!