soulhealer Posted January 14, 2005 Posted January 14, 2005 hi, does anyone know how to set the left mouseclick as a hotkey trigger?? i need this to make a mouseclick catcher script... or at least, there's another way to do it?? thank's
layer Posted January 14, 2005 Posted January 14, 2005 just used Ezzetabi's _IsPressed Func... Func _IsPressed($hexKey) Local $aR, $bRv $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If $aR[0] <> 0 Then $bRv = 1 Else $bRv = 0 EndIf Return $bRv EndFunc there was an updated one somewhere, i can't find it.. example: Func _IsPressed($hexKey) Local $aR, $bRv $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If $aR[0] <> 0 Then $bRv = 1 Else $bRv = 0 EndIf Return $bRv EndFunc While 1 If _IsPressed ('01') then;if the left mouse button is clicked MyFunc () EndIf Wend Func MyFunc () MsgBox (0, "You", "You clicked the left mouse button! Now add a function!") EndFunc FootbaG
CyberSlug Posted January 14, 2005 Posted January 14, 2005 (edited) Yes, it's possible... Try downloading http://www.autoitscript.com/fileman/users/public/CyberSlug/autowriter.zip which requires the latest AutoIt beta.Basically, my script creates an invisible window (using the the GUI functions in the latest AutoIt beta) which has support for detecting mouse clicks.I can elaborate more tomorrow.P.S. GetAsyncKeyState doesn't always work well with Windows 98, but it's great for Windows XP Edited January 14, 2005 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
soulhealer Posted January 14, 2005 Author Posted January 14, 2005 i've never used AutoItX(beta) i downloaded its .chm and .dll from download page, but still don't know how to integrate it with AutoIt(in short, i don't know how to start AutoItX)
therks Posted January 14, 2005 Posted January 14, 2005 Not AutoItX. That's something else entirely. The AutoIt3 beta.Get it here: http://www.autoitscript.com/autoit3/files/...it-v3.0.103.exe My AutoIt Stuff | My Github
soulhealer Posted January 15, 2005 Author Posted January 15, 2005 (edited) I tried the script u gave, it worx, but there's a problem, take a look on the codes:Hotkeyset("{PGDN}","ExitSC")HotKeyset("{PAUSE}","StartSC")Global $routefileGlobal $mouseposGlobal $delaynumGlobal $timersGlobal $sleepGlobal $mouseclickGlobal $script$routefile = FileOpen("route.au3",1)While 1WEndFunc _IsPressed($hexKey) Local $aR, $bRv $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If $aR[0]<> 0 Then $bRv = 1 Else $bRv = 0 EndIf Return $bRvEndFuncFunc MyFunc ()$mousepos = MouseGetPos()$delaynum = TimerDiff($timers)$sleep = "Sleep(" & $delaynum & ")" ; Will be returned as *sleep(delay)*$mouseclick = 'MouseClick("left",' & $mousepos[0] & ',' & $mousepos[1] & ',1,0)' ; Will be returned as *MouseClick(function parameters)*FileWriteLine($routefile,$sleep)FileWriteLine($routefile,$mouseclick)$timers = TimerInit() ; Reset timer and start counting time delay for the next clickWhile _IsPressed('01') ; This is supposed to hold the script execute this function more than twice if left mouse button still in "hold".WEnd ; When left mouse button is released, the function is prepared to go for the next executionEndFuncFunc StartSC()$timers = TimerInit() ; Start counting time delay from start to the first click$script = NOT $scriptWhile $script AND _IsPressed('01') ;MyFunc ()WendEndFuncFunc ExitSC()ExitEndFuncThe route.au3 that the main script generated:Sleep(0.19471748504349)MouseClick("left",352,586,1,0)Sleep(0.254501619619253)MouseClick("left",308,573,1,0)ok, the problem is on the Sleep(blablabla)it supposed to be more than 3000 ms, coz i start to clicking after 3 seconds, and the second problem is, it should return more than 4 mouseclicking(not just2).the main purpose of the script is, to capture mouseclicks and count it delays between single-mouseclicks(instant click, won't capture more than twice if the left mouse is hold) and then put those into a file as route.au3. and the script would only start to capture mouseclicks after pressing "PAUSE" key.could anyone tell me what's wrong?thank you Edited January 15, 2005 by soulhealer
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now