..:: PCSX2 Forums ::..

Full Version: Send key press to inactive game window (python win32api)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all.
I'm trying to write a script that would send a "key press" to an inactive game window (via python 3.10.4 + win32api).
At first I tried to implement sending to the active window - everything worked out (the script is attached). Implemented via win32api.keybd_event.
But it doesn't work with an inactive window - I find the handle of the window, I call win32api.PostMessage - and there is no reaction in the game.
Configuration: Win10 x64, PCSX2 v.1.6.0, LilyPad v.0.12.1, Keyboard API - Windows messaging (Recommended).
Attached both scripts (.txt format, because .py did not want to load)
Tell me, please, what is the root of the problem.

Edit: Improved the dq8_auto_win_inactive script a little, checked - it works with win Calculator if "5" is sent, but not with the PCSX2 game window...