So I wrote a Python package to do exactly that. So, to solve the problem we have, we just need to get PyAutoGUI to use the DirectInput Windows APIs instead of what it’s currently using. A lot of times, game developers will choose to only support DirectInput, because it's less development and players aren't likely to ever notice.
And DirectInput is basically an easier and more powerful interface for video game developers to use when dealing with user input for their game. One of the subsets of DirectX is DirectInput. It's been super successful, and it’s basically why Windows dominates PC gaming. If you don’t know what DirectX is, it's just a collection of libraries and APIs, written by Microsoft, to make video game development easier. Normally this is fine, but when you’re interacting with programs that make heavy use of DirectX, like most 3D video games do, you can run into problems. So why doesn't PyAutoGUI work with some video games? On Windows, PyAutoGUI uses a slightly older, slightly deprecated Windows API to simulate mouse and keyboard inputs.
So in this video, I'm going to explain what's going on and show you how you can fix it.
Since my video game botting tutorial, where we used PyAutoGUI, multiple people have told me that PyAutoGUI doesn't work with the video game they're playing.