How to activate hotkeys only if the game process is a child of steam process?

Ask gaming related questions (AHK v1.1 and older)
S0L
Posts: 21
Joined: 22 Jan 2014, 09:34

How to activate hotkeys only if the game process is a child of steam process?

17 Feb 2016, 09:00

Guys and girls hi! Fellow member Lifeweaver helped me to complete this script, but one question still bugs me, how to limit hotkeys to certain process, or window or if it started as child of steam.exe process? You see i am running most of my games through steam application and the thing that i want in this script is to limit on which processes this script applies. Ideally i want this: "If process wargame.exe is a child of steam.exe apply this script to him" Can this be done? And if it can could you please direct me from where to start.

Thanks for the time!

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
 
i := 0
toggle := 0
 
$PrintScreen:: ; <---- MSI Afterburner 10x screenshots
 
 
    toggle := !toggle
    if (toggle) {
        SetTimer, scr1, -10 ; Negative period only runs once
    } else {
        SetTImer, scr1, Off
    }
 
return
 
$Pause:: ; <---- MSI Afterburner auto repeat screenshot
 
 
    toggle := !toggle
    if (toggle) {
        SetTimer, scr2, On
    } else {
        SetTImer, scr2, Off
    }
 
return
 
scr1:
  Loop, 10
  {
    SetKeyDelay, 1000, 0
    SendEvent, {Insert}
  }
return
 
scr2:
  SetKeyDelay, 1500, 0 ; can be whatever you want
  SendEvent, {Insert}
 
return
 

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 27 guests