I've been trying to write a script that sends specific key presses to the game, however they just get "ignored", while the script can send the exact same key presses to any other window without a problem. I'm using WIN 10 x64, python 3.9 and pyautogui and pywinatuo.
Is there an easy way around this? Please consider my inexperience with coding when answering.
I had a similar problem and ended up sending the desired keystroke out to a serial port, using the 'serial' module the writing some code on a 'pro micro' using an arduino ide which would accept any character coming in on the serial port and would then output said character or string to a the usb. The neat thing about the pro micro is the serial port and the usb can be same physical connection. While I had to make exceptions for some special characters like \r and \n it works quite well. Where my application that would not recognize keyboard or mouse inputs from pyautogui or pywinauto, it now does recognize them when coming from the usb as it looks like any other piece of hardware. If you are interested I will send/post the code for the pro micro and some examples of how I used it.
How does a program distinguish between real key presses and those sent by pyautogui, pywinauto etc.?