Page 1 of 1

Sending Key on background process

Posted: 16 Jul 2018, 10:07
by kurapicas
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

Re: Sending Key on background process

Posted: 16 Jul 2018, 12:09
by Scr1pter
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

Re: Sending Key on background process

Posted: 17 Jul 2018, 15:26
by kurapicas

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