send different keystrokes to different programs

Ask gaming related questions (AHK v1.1 and older)
yazan
Posts: 1
Joined: 19 Oct 2017, 18:24

send different keystrokes to different programs

19 Oct 2017, 18:43

hello!
I'm totally new to Autohotkey, All i need to do is this:
by clicking F4, the script will send F6 to a window containing the title "notepad" and will send F7 to a window containing the title "Paint"
this is obviously an example, but i will edit the script for my need.
and i guess it's possible to send the keystrokes as much as i want,i.e i can click F4 3 or 4 times a second, sorry i'm totally new to Autohotkey and its capabilities :\
Thanks alot
Rohwedder
Posts: 7647
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: send different keystrokes to different programs

21 Oct 2017, 01:20

Hallo,
this script sends only to the active window:

Code: Select all

SetTitleMatchMode, 2
#IfWinActive, Notepad
	F4::F6
#IfWinActive, Paint
	F4::F7
this script sends to existing windows:

Code: Select all

SetTitleMatchMode, 2
F4::
	ControlSend,,{F6}, Notepad
	ControlSend,,{F7}, Paint
Return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: joedf and 83 guests