Sign in to follow this  
Followers 0
mrnoob

Do...until Keypress

4 posts in this topic

I'm trying to execute a Funciton directly after a keypress, like so:

Do
    Sleep(100)
Until "F button is pressed"

Pressing F activates the function. I know its possable, but I couldnt find any command in the help or forum search :)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

HotKeySet("{F}", "Stop")

Dim $Go

$Go=1
While $Go==1
Sleep(100)
Wend

Func Stop()
$Go=0
Endfunc

While 1
Sleep(1000);Reduces CPU Usage
Wend

Edited by =sinister=

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Use _IsPressed. It's in the beta helpfile.

That's if you don't want a hotkey... hotkeys are more accurate.

Edited by greenmachine

Share this post


Link to post
Share on other sites

Ahh, Thanks very much to both of you. I ended up using _Ispressed as it better suited my needs. Ill have to remeber the Beta help book next time.

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