Sending Key on background process

Ask gaming related questions (AHK v1.1 and older)
kurapicas
Posts: 4
Joined: 16 Jul 2018, 09:33

Sending Key on background process

16 Jul 2018, 10:07

Im playing a private server game called Bright Shadow

Window Name: Bright Shadow
ahk_class BrightShadow
Process: Shadow.exe

Now how do i send "D" button with the game running in background so I can watch hulu at same time on Chrome and the game still pressing D while is minimize.

Code: Select all

WinActivate, ahk_id BrightShadow
ControlSend, , d, Shadow.exe 
SetControlDelay, 30
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Sending Key on background process

16 Jul 2018, 12:09

Hi,

Why do you use WinActivate if you want the game being in background?
Where did you get this code from?

Try:

Code: Select all

F1::
ControlSend, d, ahk_class BrightShadow
SetControlDelay, 30
return
You can change F1 to any other key.
If it doesn't work, try:
ControlSend, , d, ahk_class BrightShadow

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
kurapicas
Posts: 4
Joined: 16 Jul 2018, 09:33

Re: Sending Key on background process

17 Jul 2018, 15:26

Code: Select all

F1::
ControlSend, , d, ahk_class BrightShadow
SetControlDelay, 30
return
This works but it does not work repeatedly. (I have to press F1) myself.

What im looking is repeat pressing D button while im watching hulu at fullscreen (im far away from my computer so I cant press F1) by myself manually.

Nevermind Fixed it.

Code: Select all

F1::
  $stop := 0
  Loop, 
  { 
    ControlSend, , d, ahk_class BrightShadow
    Sleep 30000 
    if ($stop)
    {
      return
    }
  }

F2:: $stop := 1

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 42 guests