autohotkey


Autohotkey loop sequence with idle reset


I cobbled the following together from various posts:
keys = 0,9,8,7
loop, parse, keys, `,
{
Key_%A_Index% := A_LoopField
KeyCount++
}
return
XButton1::
Rotation ++
Send % Key_%Rotation%
if Rotation = %KeyCount%
Rotation = 0
return
#Persistent
SetTimer, Check, 1000 ;check every second
return
Check:
If (A_TimeIdle >= 3000)
Rotation = 0
return
The idea being that I press my mouse4 button and it cycles through the keys and then goes back to start, however I also wanted a loop so that if I don't press the button for 3 seconds, it resets back to the start of the sequence. The key sequence works however the idle reset doesnt and I'm not sure where to go from here to debug it.
1- You must let the #Persistent SetTimer, Check, 1000 part before the first return.
2- A_TimeIdle is sensible to any input, even a simple mouse move (by user or by script) resets it to zero. If you want to get the Idle time of this single hotkey use A_TimeSinceThisHotkey instead:
Check:
if (A_TimeSinceThisHotkey >= 3000)
{
Rotation = 0
}
return

Related Links

AutoHotKey stopped working after plugging new keyboard, even if I restart computer
Autohotkey script: Works everytime only in Notepad: Copy text to clipboard, manipulate it, and paste it
AHK: Script Help Num Lock acting up
AutoHotKey: How to find out if a certain window has or hasn't been interacted with
Win + mouse wheel keeps showing/hiding start menu
Generate timed-text synchronised with Text-to-Speech word-by-word?
AHK: closing a window whenever it pops up
AutoHotKey How to save file as XPS without dialog box
Autohotkey script doesn't work only in Skype
Gui clipboard not working
Restart script as admin, avoiding the error message
How to capture Logitech trackman special buttons using Autohotkey?
AHK: Automation of dialog boxes
How to send enter key when ever dialogue box is appears
How to set Autohotkey Gui control type slider as float?
Replace key by dot (“.”) with Shift Autohotkey

Categories

HOME
c#
primefaces
sip
pyspark
mysqli
intellisense
liquibase
glsl
readdir
hex
okhttp3
symfony-sonata
ebay
browser-cache
foreach
richtextbox
install
rethinkdb
google-search-appliance
websharper
virtualenv
opengrok
minimum
jquery-easyui
android-actionbar
indri
opengraph
v4l2
bootstrap-accordion
dynamic-memory-allocation
windows-10-mobile
sphinx4
tikz
motherboard
anypoint-studio
pygraphviz
word-wrap
cowboy
google-chrome-console
delphi-xe
directadmin
python-venv
ack
text-formatting
react.rb
confluent
openxava
playframework-2.3
seyren
r-commander
jtextarea
wicketstuff
ios-keyboard-extension
cardview
copy-constructor
toggleclass
scikit-image
networkstream
tinybox2
magick.net
treelist
periodic-processing
ideavim
skbio
clear
consul-template
esb-toolkit-2.1
parseexception
applinks
method-overloading
dojox.grid
mind-manager
disabled-control
sigma-grid-control
dayofweek
lastinsertid
ironworker
windows-scheduler
pudb
algol
cron4j
netbiscuits
states
ios6-maps
joomla1.7
apache-commons-email
rjs
windows-xp-embedded
jqtransform
llblgen
viewdata
jquery-attributes
morfik
file-storage
datadude
expander
httpbrowsercapabilities

Resources

Encrypt Message