Jump to content

Func IsPressed question


Cuervo
 Share

Recommended Posts

Hey all,

I'm going through some scripts looking at samples of code and I see this. What purpose or function does it serve? I've also seen references that this is no longer needed as it is a duplicate function from an #include now, possible Misc.au3 file.

Func _IsPressed($sHexKey, $vDLL = 'user32.dll')
    ; $hexKey must be the value of one of the keys.
    ; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is.
    Local $a_R = DllCall($vDLL, "int", "GetAsyncKeyState", "int", '0x' & $sHexKey)
    If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1
    Return 0
EndFunc   ;==>_IsPressed

-Tim

Link to comment
Share on other sites

Look in the help file, under User Defined Functions Reference -> Misc Management -> _IsPressed

Or, if you prefer, type _IsPressed in the helpfile's search box on the "Index" tab ...

hth,

whim

I do read the help files as well as do a search on this forum along with google before posting. Like a lot of non progammers without getting pretty specific help I'm clueless on most of the aspects about programming.

I did however find the function in the Misc.au3 file so I can assume that an include would mean this function is not needed in a file.

Thanks for helping.

Edited by Cuervo

-Tim

Link to comment
Share on other sites

You no longer have to manually include this function in one of your scripts. It was added to the standard libraries some time ago, before this many people copy-pasta it from a topic in the example script, to save them this trouble, and because there were several versions, the best version was added to the standard libraries.

Like a lot of non progammers without getting pretty specific help I'm clueless on most of the aspects about programming.

Like a lot of people, without getting specific questions, I'm pretty clueless on what to give as answer.
Link to comment
Share on other sites

You no longer have to manually include this function in one of your scripts. It was added to the standard libraries some time ago, before this many people copy-pasta it from a topic in the example script, to save them this trouble, and because there were several versions, the best version was added to the standard libraries.

Like a lot of people, without getting specific questions, I'm pretty clueless on what to give as answer.

Thanks, I see we have something in common. I do appreciate your responce.

-Tim

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