Use Python to send keystrokes to games in Windows?
问题 I've been working with Python in a Windows environment and I wrote a script to automate some tasks in a known game. The task involves heavy use of both mouse and keyboard inputs. Said script, however, has only one issue: it cannot send keystrokes to the application. I've tried at least 3 different methods that I shall post below and some variations (also read tenths of similar questions/answers, to no avail) First one, using the win32api module: f = 0x46 # VirtualKey Code of the letter "F",