Page 1 of 1

Press X key repeatedly while being able to use other buttons

Posted: 22 Jun 2018, 23:13
by Arkady
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"?

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

Posted: 24 Jun 2018, 08:44
by Qysh
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