Jump to content

Recommended Posts

Guest Rhuno
Posted

Hey folks, I was wondering if there was any way to check for a left mouse click by the user. I know you can send a mouseclick, but I need something to react to a user-initiated mouse click. Is there a mouse click code that can be used with the SetHotKey function? If so, please let me know. Thanks.

Posted (edited)

Hey folks, I was wondering if there was any way to check for a left mouse click by the user.  I know you can send a mouseclick, but I need something to react to a user-initiated mouse click.  Is there a mouse click code that can be used with the SetHotKey function?  If so, please let me know.  Thanks.

<{POST_SNAPBACK}>

Try this, just replace the msgbox with some func

Opt("MouseCoordMode", 2);relative to active window
$WS_POPUP = 0x80000000;borderless window

GuiCreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GuiSetState(@SW_HIDE)
While 1
    $i = GuiGetCursorInfo()
    If $i[2] = 1 Then;Left mouse click initiated
        MsgBox(0,"Mouse Click","Mouse Left Click Initiated at X" & $i[0] & "  Y" & $i[1])
    EndIf
    Sleep(1)
Wend
Edited by bshoenhair
Guest Rhuno
Posted

Awesome, that did the trick! Thanks for your help.

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
×
×
  • Create New...