Jump to content

Detect Key Loop


Shinies
 Share

Recommended Posts

Hey, im still learning AutiIt and im not very familiar with loops, is there a way that i can set my script to detect whenever the "I" key is pressed and then Send("b") - I need that to happen whenever i press i throughout the script. If anyone one could give me some clues as to how i could do this, thank you. ;)

Link to comment
Share on other sites

Yes.... bts possbble

rbght now every tbme b press the b key a "b" shows bnstead

and here bs the scrbpt

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused, $t
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("i", "ShowMe");This is your key (i)

;;;; Body of program would go here;;;;
While 1
    
    
    Sleep(10)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMe()
    
    Send("b")

EndFunc

Enjoy!!!

8)

Edited by Valuater

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...