Sign in to follow this  
Followers 0
dazza

Switch-case on a _IsPressed?

4 posts in this topic

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?

Share this post


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

Share this post


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

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?


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  
Followers 0