JamieRollins Posted April 2, 2006 Posted April 2, 2006 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!
greenmachine Posted April 2, 2006 Posted April 2, 2006 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).
herewasplato Posted April 2, 2006 Posted April 2, 2006 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_SpacesYou 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]
greenmachine Posted April 2, 2006 Posted April 2, 2006 Hmm, looks like I forgot about HotKeySet stealing the key. Thanks for the fix plato.
herewasplato Posted April 2, 2006 Posted April 2, 2006 Hmm, looks like I forgot about HotKeySet stealing the key. Thanks for the fix plato.Anytime... :-) [size="1"][font="Arial"].[u].[/u][/font][/size]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now