Send keys to inactive window

Ask gaming related questions (AHK v1.1 and older)
MulPen
Posts: 5
Joined: 28 Nov 2018, 14:21

Send keys to inactive window

29 Mar 2024, 10:59

Hello!

I created a simple script to spam only one key in a specific interval, but of course this only works when the window is active, is there a way to continue sending this key when I minimize the window? I read a little about PID and ControlSend() function but couldn't figure it out how to apply on my case.

The game process is always "UOF.exe" if this helps...

Here's my script:

Code: Select all

#NoEnv
#MaxThreadsPerHotkey 2
toggle := 0

z::
    Toggle := !Toggle
    While Toggle
    {
	Send, {F1 down}
	Sleep, 20
	Send, {F1 up}
	Sleep, 30
    }
return
[Mod edit: Moved topic from AHK v2 help since this v1 code.]
gregster
Posts: 9035
Joined: 30 Sep 2013, 06:48

Re: Send keys to inactive window

30 Mar 2024, 01:44

There is also a v2 version of this question: viewtopic.php?f=94&t=128031

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 49 guests