Alternating Keys

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Alistar2013

Alternating Keys

02 Jun 2016, 04:04

How would I create a script to rapidly alternate between the left and right arrow keys when I hold down a hotkey? Below is what I have so far, I can't seem to get it to work properly.
v::
Loop
{
Send {Left}
Sleep 10
Send {Right}
}
Return
User avatar
waetherman
Posts: 112
Joined: 05 Feb 2016, 17:00

Re: Alternating Keys

02 Jun 2016, 04:27

This?

Code: Select all

v::
	While ( GetKeyState("v") ) {
		Send {Left}
		Sleep 10
		Send {Right}
	}
	Return
Image
Alistar2013

Re: Alternating Keys

03 Jun 2016, 00:43

It seems to work, just not for the game I'm playing. Tried some different things, oh well it's not meant to be :P
User avatar
waetherman
Posts: 112
Joined: 05 Feb 2016, 17:00

Re: Alternating Keys

03 Jun 2016, 02:54

Code: Select all

SetKeyDelay, 50, 50

v::
	While ( GetKeyState("v") ) {
		Send {Left}
		Sleep 10
		Send {Right}
	}
	Return
If this doesn't work as well, try running the script as administrator. If still no success, you can try

Code: Select all

SendMode, Play
SetKeyDelay, 50, 50

v::
	While ( GetKeyState("v") ) {
		Send {Left}
		Sleep 10
		Send {Right}
	}
	Return
If still no success, you can disable UAC in Your Windows, restart it, then run the script as administrator.
Image

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], DecimalTurn, macromint, peter_ahk and 356 guests