SendInput not working in game app

Ask gaming related questions (AHK v1.1 and older)
hsn36
Posts: 1
Joined: 20 Nov 2023, 10:15

SendInput not working in game app

20 Nov 2023, 10:18

Hey everyone,
I wrote a basic script like this ;

Code: Select all

SetKeyDelay, 1000
Joy5::SendInput, 5
Joy4::SendInput, {Up}
Joy12::SendInput, {Down}
return
But joy4 and joy12 is not working in game app. Can anyone help me with this ?

[Mod edit: Moved topic from AHK v2 help, since this is v1 code.]
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: SendInput not working in game app

20 Nov 2023, 12:11

Read: SetKeyDelay
Remarks
Remarks
If SetKeyDelay is not used, the default delay is 10 for the traditional SendEvent mode and -1 for SendPlay mode. The default press duration is -1 for both modes.

SetKeyDelay is not obeyed by SendInput; there is no delay between keystrokes in that mode. This same is true for Send when SendMode Input is in effect.
Change SendInput to Send, the default send mode is event and then SetKeyDelay will work. You will likely want to set the PressDuration parameter of SetKeyDelay also when sending keystrokes to a game. example: SetKeyDelay, 1000, 50

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 92 guests