Jump to content
Sign in to follow this  
Shinies

Detect Key Loop

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. ;)

Share this post


Link to post
Share on other sites

i want to it be continuoustly checking to see if "i" is pressed (i guess thats what i meen by loop) and every time it is pressed i want it to Send("b"). is that possible?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

can i do the same thing but the key when its pressed

autoit doesnt recognize is so i have to use _ispressed script someone posted which checks directly from keyboard input.

can i do that?

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...