Send key press to inactive game window (python win32api)
#1
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...


Attached Files
.txt   dq8_auto_win_inactive.txt (Size: 4,41 KB / Downloads: 207)
.txt   dq8_auto_win_active.txt (Size: 3,53 KB / Downloads: 141)
Reply

Sponsored links





Users browsing this thread: 3 Guest(s)