Jump to content

What happened to getkeystate? Need quick help please


Recommended Posts

Hey everyone,

I just switched from Autohotkey to Autoit v3. So im learning all the differences between the versions of autoit and such. Anyways, Im not sure what happened to the getkeystate command or how its called on this version. But could one of you more experienced guys help me set up a loop that ends when the enter key is pressed. I noticed that all the loops in version 3 are do whiles or do untils. So im trying to

DO

SCRIPT

UNTIL ENTER KEY PUSHED

can i get some help with the loop code please?

Link to comment
Share on other sites

Well we have both _IsPressed and HotKeySet. HotKeySet just binds a key to a functions, _IsPressed well...checks if a key is pressed.

But whats the description for enter? I dont know the ASCII stuff. I tried looking it up on microsoft that was a disaster.

Would it look something like Until "Enter" _ispressed ?

Link to comment
Share on other sites

The Ascii codes are in the help file under "Appendix".

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    TrayTip("I'm Waiting","Please press ENTER sometime today!!", 30)
    If _IsPressed("0d", $dll) Then
        MsgBox(0,"_IsPressed", "Enter Key Pressed")
        ExitLoop
    EndIf
WEnd
DllClose($dll)
Link to comment
Share on other sites

The Ascii codes are in the help file under "Appendix".

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    TrayTip("I'm Waiting","Please press ENTER sometime today!!", 30)
    If _IsPressed("0d", $dll) Then
        MsgBox(0,"_IsPressed", "Enter Key Pressed")
        ExitLoop
    EndIf
WEnd
DllClose($dll)
Thanks for your help guys, sorry for being so new to this
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...