Sign in to follow this  
Followers 0
JamieRollins

Simple Key Repeater

5 posts in this topic

i'm just getting started on this, could someone just post a simple key repeater.. ex: when space pressed it simulates pressing space repeatedly.

thx!

Share this post


Link to post
Share on other sites



Look up HotKeySet in the helpfile.

HotKeySet ("{SPACE}", "Lots_Of_Spaces")

While 1

Sleep (100)

WEnd

Func Lots_Of_Spaces()

HotKeySet ("{SPACE}")

Send ("{SPACE}")

HotKeySet ("{SPACE}", "Lots_Of_Spaces")

EndFunc

That sends 1 extra space for every space you press (hold it down to do more, or put that in a loop).

Share this post


Link to post
Share on other sites

The space key that the human presses is "absorbed" by HotKeySet --- so the function must send at least 2 spaces to do what you wanted. Try this:

HotKeySet("{SPACE}", "Lots_Of_Spaces")

While 1
    Sleep(100)
WEnd

Func Lots_Of_Spaces()
    HotKeySet("{SPACE}")
    Send("{SPACE 2}")
    HotKeySet("{SPACE}", "Lots_Of_Spaces")
EndFunc  ;==>Lots_Of_Spaces
You can change the 2 in this line Send("{SPACE 2}") to increase the number of spaces that will be sent each time you press the space bar.

Welcome to the forums JamieRollins. Enjoy greenmachine's code with my minor tweak...


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Hmm, looks like I forgot about HotKeySet stealing the key. Thanks for the fix plato.

Share this post


Link to post
Share on other sites

Hmm, looks like I forgot about HotKeySet stealing the key. Thanks for the fix plato.

Anytime... :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0