send {f1} not working in a game Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
NewberEnerNeeder1
Posts: 47
Joined: 26 Mar 2019, 06:06

send {f1} not working in a game

20 Oct 2019, 05:43

Code: Select all

x::
{
send {f1}
sleep 1000
send {f1}
}
return

for some reason the game doesnt recognize that f1 is being pressed from the ahk script.

any ideas to fix this?
gregster
Posts: 9064
Joined: 30 Sep 2013, 06:48

Re: send {f1} not working in a game  Topic is solved

20 Oct 2019, 06:01

Perhaps longer keypress duration needed (try SetKeyDelay 0,50), perhaps wrong send mode, perhaps fullscreen mode that messes it up - try (borderless) windowed mode instead.

There are lots of possible reasons. Some games won't cooperate at all.
Perhaps go through this: https://www.autohotkey.com/boards/viewtopic.php?t=11084 .

Also: https://www.autohotkey.com/docs/FAQ.htm#games
NewberEnerNeeder1
Posts: 47
Joined: 26 Mar 2019, 06:06

Re: send {f1} not working in a game

20 Oct 2019, 19:48

solved
Last edited by NewberEnerNeeder1 on 21 Oct 2019, 08:12, edited 1 time in total.
gregster
Posts: 9064
Joined: 30 Sep 2013, 06:48

Re: send {f1} not working in a game

21 Oct 2019, 04:17

Do you want to hold F1 once for 1000ms or send two F1s with a pause of 1000ms ?

Hold F1 for 1 sec:

Code: Select all

x::
send {f1 down}
sleep 1000
send {f1 up}
return
To send two F1s, try this (based on the working script that you provided).

Code: Select all

x::
send {f1 down}
sleep 1
send {f1 up}
sleep 1000
send {f1 down}
sleep 1
send {f1 up}
return
Or

Code: Select all

x::
SetKeyDelay, 0, 20	; or:   SetKeyDelay, 0, 50   or play around with different values.	
send {f1}
sleep 1000
send {f1}
return
NewberEnerNeeder1
Posts: 47
Joined: 26 Mar 2019, 06:06

Re: send {f1} not working in a game

21 Oct 2019, 08:11

wow guess it needed a delay ty greg.

i tried so many things figured it was something simple

send (f1) didnt work
but with that key delay it did

or the f1 down

and f1 up

that worked with a small delay ty again

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Google [Bot] and 340 guests