Jump to content

Mouseclicks


Das Ami
 Share

Recommended Posts

  • Moderators

Hey guys I'm trying to make a mouseclick recorder, is there any way to use mousclicks as hotkeys or capture them some other way?

I thought it may be possible with dll's but I never really used them.

Look at _IsPressed() in the help file.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

just quick example:

;Example
If _IsPressed('ASCII Hex') Then
    _LogKeyPress("{END}")
EndIf

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   ;==>_IsPressed

Func _LogKeyPress($what2log)
    $window = WinGetTitle("")
    If $window = $window2 Then
        FileWrite($file, $what2log)
        Sleep(100)
    Else
        $window2 = $window
        FileWrite($file, @CR & @CR & "[" & @YEAR & "." & @MON & "." & @MDAY & "  " & @HOUR & ":" & @MIN & ":" & @SEC & ']  Window: "' & $window & @CR & @CR & $what2log)
        Sleep(100)
    EndIf
EndFunc   ;==>_LogKeyPress

You can check up the ASCII hexes at www.lookuptables.com (i got no idea.. if this also includes' mouseclicks.)

Edited by aceloc

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Link to comment
Share on other sites

just quick example:

;Example
If _IsPressed('ASCII Hex') Then
    _LogKeyPress("{END}")
EndIf

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   ;==>_IsPressed

;sec... under construction :D

You can check up the ASCII hexes at www.lookuptables.com (i got no idea.. if this also includes' mouseclicks.)

Awesome thanks. :)

in SciTE editor there is "Au3Recorder" under "Tools"

8)

I am aware of that but I'm trying to make my own.
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...