Sign in to follow this  
Followers 0
seraphant

Counteract User Imput?

6 posts in this topic

is there a way to make the script respond to user keystrokes?

i.e

the script im making goes out of synch and becomes more or less useless if th user messes with the keyboard. I need a way to use the Send command to respond to the user.


~Sera

Share this post


Link to post
Share on other sites



AutoHotKey (aka AHK, which is an AutoIt2 derivative) provides a bunch of keyboard controls, such as GetKeyState. Check it out.

BTW: You can use your existing A2 scripts with AHK !

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Both AutoIt3 and AutoHotkey provide protection against the user physically pressing or releasing keys during a Send operation. There is a v2 to v3 script translator that can do some of the work for you if you want to convert to v3.

Alternatively, if you're using NT/2k/XP, AutoHotkey in particular has a keyboard hook which keeps track of exactly what keys the user is physically holding down and uses that info to automatically compensate during the Send operation (even if the user releases or presses multiple keys while the send is ongoing). If you need that ultimate level of protection (above and beyond the basic protection already present), you can use the #InstallKeybdHook command.

Edited by cmallett

Share this post


Link to post
Share on other sites

why not use BlockInput, <on | off> ?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

That's an interesting idea and might work in some cases. But most of the common cases involve the user pressing a hotkey to trigger the Send operation. If BlockInput were turned on while the user is holding down keys, I suspect the state of the keys might get messed up. It's worth further investigating, however, so I'll check it out. Thanks.

Edited by cmallett

Share this post


Link to post
Share on other sites

I that case I usually use a imput dialog

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0