illya Posted April 11, 2008 Share Posted April 11, 2008 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 exitIt is supposed to work whereever I have my mouse atm, in firefox or in notpadI found the info on;http://www.autoitscript.com/autoit3/docs/f...ISetOnEvent.htmBut I didnt understand enough to find the answer for the above Link to comment Share on other sites More sharing options...
Zedna Posted April 11, 2008 Share Posted April 11, 2008 Look here at MouseHook Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
illya Posted April 11, 2008 Author Share Posted April 11, 2008 I'm sorry I just dont understand how it works 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) Link to comment Share on other sites More sharing options...
z0mgItsJohn Posted April 11, 2008 Share Posted April 11, 2008 Simple Mistake Forgot To Add.. Opt ('GUIOnEventMode','1') Hope This Helps! ~ John Latest Projects :- New & Improved TCP Chat Link to comment Share on other sites More sharing options...
illya Posted April 12, 2008 Author Share Posted April 12, 2008 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? Link to comment Share on other sites More sharing options...
therks Posted April 12, 2008 Share Posted April 12, 2008 GUISetOnEvent is for a GUI. You don't have a GUI. Someone wrote a UDF specifically for what you seem to want. Have a look at MsCreatoR's _MouseSetOnEvent functions. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
illya Posted April 12, 2008 Author Share Posted April 12, 2008 (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 April 12, 2008 by illya Link to comment Share on other sites More sharing options...
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