Sending a key to an inactive game Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Encko

Sending a key to an inactive game  Topic is solved

02 Apr 2018, 08:34

Hi there !
I know this subject has been treated a lot but I couldnt make it work !

I have a game and I wanted to send to it a simple key every minute, the thing is I would want to do something else while the macro do that, Like playing another game and stuff...

I searched a lot and found a ton of script but none of them worked for me, Tried to do some myself but same

Here what I have for now

Code: Select all

#z:: ; Windows Key + Z

WinActivate, ahk_class LifeIsFeudalWindow

SetTimer, SendKeys , 3000
return

SendKeys:
  IFWinExist, ahk_class LifeIsFeudalWindow
{
   ControlSend, , -, ahk_class LifeIsFeudalWindow

}
return
This one work if I have the focus of the game, If I dont its do nothing on the game, at least it does nothing on other programme, wich is cool for start :D

any help on this ? thanks !
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Re: Sending a key to an inactive game

02 Apr 2018, 09:30

Many games are written under the (typically quite logical) assumption that if their window is not focused, they will not be receiving keypresses; often games are written to ignore any keypresses received while the window isn't focused. Many games also pause whenever they lose focus. Because of this, it's entirely possible that what you want to do simply isn't possible.
Encko

Re: Sending a key to an inactive game

03 Apr 2018, 15:33

I finally got it working using ControlFocus :)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 71 guests