Okay, so I'm trying to control my games using a python script. I tried using Keyboard event generator inside python to do this, but it seems like the game does not recognize the keyboard presses the script generates.

Code:
import win32com.client,time shell=win32com.client.Dispatch("WScript.Shell") 
while 1: 
  shell.SendKeys("w") 
  time.sleep(1)