Jump to content

Can AutoIT detect a keypress or mouseclick?


Recommended Posts

I want my script to idle until it detects a particular keystroke or mouse click...is there a command function that I can use for this? I didn't see anything that might be relevant in the function and command lists in the Help file. I'm looking for something similar to WinWait, but for the keyboard or mouse.

Thanks!

Link to comment
Share on other sites

I want my script to idle until it detects a particular keystroke or mouse click...is there a command function that I can use for this?  I didn't see anything that might be relevant in the function and command lists in the Help file.  I'm looking for something similar to WinWait, but for the keyboard or mouse.

Thanks!

<{POST_SNAPBACK}>

Search forum for "_ispressed"

Or just click the provided link and it will bring up the search for you.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Func _IsPressed($hexKey)
    $hexKey = DllCall("user32", "int", "GetAsyncKeyState", "int", '0x' & $hexKey)
    If Not @error And BitAND($hexKey[0], 0x8000) = 0x8000 Then Return 1
    Return 0
EndFunc  ;==>_IsPressed

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

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