Press X key repeatedly while being able to use other buttons

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Arkady
Posts: 1
Joined: 22 Jun 2018, 22:54

Press X key repeatedly while being able to use other buttons

22 Jun 2018, 23:13

So I want Numpad4 to be repeatedly pressed while being able to use other keys such as WASD. When I tried the script below, it allows me to repeatedly press numpad4 but does not work if Im pressing another key. Here's the code:

Code: Select all

F11:: Hotkey, *~$Space, Toggle

End::
ExitApp

*~$Space::
While GetKeyState("Numpad4")
  {
    Send, {Numpad4}
    SetBatchLines, -1
  }
Return
Side question, is there a way to press the Numpad4 faster than "SetBatchLines, -1"?
Qysh
Posts: 143
Joined: 24 Apr 2018, 09:16

Re: Press X key repeatedly while being able to use other buttons

24 Jun 2018, 08:44

Add this for the best performance

Code: Select all

#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#MaxThreadsPerHotkey 255
#KeyHistory 0
ListLines Off
Process, Priority, , A
SetBatchLines, -1
SetKeyDelay, 0, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SendMode Input

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Joey5 and 196 guests