Jump to content
Sign in to follow this  
neotrio

_IsPressed() is missing from Misc.au3?

Recommended Posts

neotrio

Hi All,

I just found that " _IsPressed() " is missing from the file "Misc.au3" which is supposed to be included while using the function.

any help?

Share this post


Link to post
Share on other sites
CWorks

it's not missing from my v3.2.0.1

I just wrote a script that uses it and it works fine

It's the last funtion in the file

in fact here's a copy and paste

;===============================================================================
;
; Description:    _IsPressed
; Parameter(s): $s_hexKey - key to check for
;                       $v_dll = Handle to dll or default to user32.dll
;
; User CallTip:   _IsPressed($s_hexKey[, $v_dll = 'user32.dll']) Check if key has been pressed. (required: <Misc.au3>)
; Return Value(s):  1 if true
;                           0 if false
; Author(s):      ezzetabi and Jon
;
;===============================================================================
Func _IsPressed($s_hexKey, $v_dll = '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($v_dll, "int", "GetAsyncKeyState", "int", '0x' & $s_hexKey)
    If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1
    Return 0
EndFunc   ;==>_IsPressed
Edited by CWorks

Share this post


Link to post
Share on other sites
neotrio

it's not missing from my v3.2.0.1

I just wrote a script that uses it and it works fine

It's the last funtion in the file

in fact here's a copy and paste

;===============================================================================
;
; Description:    _IsPressed
; Parameter(s): $s_hexKey - key to check for
;                       $v_dll = Handle to dll or default to user32.dll
;
; User CallTip:   _IsPressed($s_hexKey[, $v_dll = 'user32.dll']) Check if key has been pressed. (required: <Misc.au3>)
; Return Value(s):  1 if true
;                           0 if false
; Author(s):      ezzetabi and Jon
;
;===============================================================================
Func _IsPressed($s_hexKey, $v_dll = '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($v_dll, "int", "GetAsyncKeyState", "int", '0x' & $s_hexKey)
    If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1
    Return 0
EndFunc   ;==>_IsPressed

Thnx Buddy:D

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.