Sign in to follow this  
Followers 0
illya

GUISetOnEvent -

7 posts in this topic

I'm trying to use GUISetOnEvent but It doesnt work like I want it to.

#include <GUIConstants.au3>

Dim $var1

Send("^!r")
GUISetOnEvent ( $GUI_EVENT_PRIMARYUP, "one" )

Func one()
    var1 == 1
EndFunc

while var1 = 0
    Sleep(100)
WEnd
Send("^!r")

Im trying to make it:

Send("^!r")

then once I release the main mousebutton: Send("^!r") and exit

It is supposed to work whereever I have my mouse atm, in firefox or in notpad

I found the info on;

http://www.autoitscript.com/autoit3/docs/f...ISetOnEvent.htm

But I didnt understand enough to find the answer for the above

Share this post


Link to post
Share on other sites



I'm sorry I just dont understand how it works :D Am I supposed to create a mousehook.au3 with the 2nd code and place it in the same folder and add the first code to my code? I'm really lost here (sorry for being stupid)

Share this post


Link to post
Share on other sites

Simple Mistake Forgot To Add..

Opt ('GUIOnEventMode','1')

Hope This Helps!

~ John


Latest Projects :- New & Improved TCP Chat

Share this post


Link to post
Share on other sites

Simple Mistake Forgot To Add..

Opt ('GUIOnEventMode','1')

Hope This Helps!

~ John

I tried adding it to my code, but it didnt work:

#include <GUIConstants.au3>

Opt ('GUIOnEventMode','1')

Dim $var1

Send("^!r")
GUISetOnEvent ( $GUI_EVENT_PRIMARYUP, "one" )

Func one()
    var1 == 1
EndFunc

while var1 = 0
    Sleep(100)
WEnd
Send("^!r")

if possible, can you show where in the code it's supposed to be?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Thanks for telling, I found it to be almost perfect for my needs.

There is only one thing I need to change somehow to get it just right.

#include <MouseSetOnEvent_UDF.au3>

Send("^!r") ;press ctrl+alt+r
_MouseSetOnEvent($MOUSE_PRIMARYUP_EVENT, "MousePrimaryUp_Event")    ;Listen for mouseUp and then call MousePrimaryUp_Event
Sleep(6000) ;how long the AutoIt should stay up in case I dont click anything

Func MousePrimaryUp_Event()
    Sleep(100)      ;I tried to do this to enable the links to sense the mouseUp before Send("^!r") performed
    Send("^!r")     ;press ctrl+alt+r
    ; Here im gonna find a way to shut down the AutoIt
EndFunc

When I press the links in the menu (that ctrl+alt+r shows) they only senses the mouseDown, but to actually open the links I need it to sense the mouseUp aswell.

So the problem is that MouseSetOnEvent_UDF blocks the mouseUp.

I only want it to listen for the mouseUp and react to it, not block the mouseUp aswell.

Anyone who knows how to achieve this?

EDIT: moved the comments further to the right, and added a few things

Edited by illya

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