Sign in to follow this  
Followers 0
Guest Rhuno

Check for mouse input?

3 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  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

Share this post


Link to post
Share on other sites

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

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  
Followers 0