Sending Key on background process

Ask gaming related questions
kurapicas
Posts: 2
Joined: 16 Jul 2018, 09:33

Sending Key on background process

Post by kurapicas » 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: 431
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Sending Key on background process

Post by Scr1pter » 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
I'm not an expert, just an enthusiastic AutoHotkey user. 8-)
Please do not support cheaters!
Keyboard: Logitech G15 first generation - Mice: Logitech G9, G502, G602 - OS: Windows 7 Pro 64 Bit - AHK version: 1.1.29.00
kurapicas
Posts: 2
Joined: 16 Jul 2018, 09:33

Re: Sending Key on background process

Post by kurapicas » 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
Post Reply

Return to “Gaming”