Jump to content

Switch-case on a _IsPressed?


Recommended Posts

My code is this:

$dll=DllOpen("user32.dll")
For $key = 32 to 126
        
        $hex = hex($key)
        If _IsPressed($hex, $dll) Then
          consolewrite($hex & "/" & chr($key) & @crlf)
          $key = 127
              While _IsPressed($hex) = 1
              WEnd
        EndIf
        
    Next

Is there a way I can return the key without looping through? Maybe a switch or querying the dll and returning the key value?

Link to comment
Share on other sites

To join SPECTRE and take over the world!!!!!

MUHAHAHHAHAH <-- evil laugh

Give an advanced member some credit. The routine already captures keys; I'm simply asking for a more codey efficient way.

Link to comment
Share on other sites

  • Developers

To join SPECTRE and take over the world!!!!!

MUHAHAHHAHAH <-- evil laugh

Give an advanced member some credit. The routine already captures keys; I'm simply asking for a more codey efficient way.

When you are so advanced then why bother asking a question that has been asked so many times?

PS: Not sure if you are trying to be funny but just for the record:you aren't?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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