adik2dmax666 Posted June 24, 2010 Share Posted June 24, 2010 (edited) Hellow poh, I'm creating a web browser using pure autoit(but using IE commands) and one of the features i would like to add is the Mouse Gestures ( while holding right mouse button, swing the mouse left to go back to the previous page or swing right to go 1 page forward) Here is the script that i've thought so far but it doesn't work very well Func _mouseGesture() If _IsPressed(02) Then ;If rightmouse button is pressed $coords = MouseGetPos() ;get initial mouse coords While _IsPressed(02) ;while rightmouse is still down sleep(500) $coords2 = MouseGetPos() ;get the new coords of the mouse If $coords2[0] < ($coords[0]-100) Then ;if the new coords is less than, which means it has lesser value of x, then it's located at the left MsgBox(0,"aw","left") sleep(1000) ElseIf $coords2[0] > ($coords[0]+100) Then ;if the new coords is greater than, which means it has greater value of x, then it's located at the right MsgBox(0,"aw","right") EndIf WEnd EndIf EndFunc Edited June 24, 2010 by adik2dmax666 First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack. -George Carrette[sub]GD Keylogger Creator (never released)[/sub][sub]Garena Autojoin v3.0[/sub] Link to comment Share on other sites More sharing options...
Bert Posted June 24, 2010 Share Posted June 24, 2010 (edited) I would think the sleep statements are what is making it now work well. I fiddled around with them and I have it working pretty well. I like the idea you have in mind. #Include <Misc.au3> while 1 _mouseGesture() wend Func _mouseGesture() If _IsPressed(02) Then ;If rightmouse button is pressed $coords = MouseGetPos() ;get initial mouse coords While _IsPressed(02) ;while rightmouse is still down sleep(100) $coords2 = MouseGetPos() ;get the new coords of the mouse If $coords2[0] < ($coords[0]-50) Then ;if the new coords is less than, which means it has lesser value of x, then it's located at the left MsgBox(262144,"aw","left") ElseIf $coords2[0] > ($coords[0]+50) Then ;if the new coords is greater than, which means it has greater value of x, then it's located at the right MsgBox(262144,"aw","right") EndIf WEnd EndIf EndFunc Edited June 24, 2010 by Volly The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
JohnOne Posted June 24, 2010 Share Posted June 24, 2010 (edited) That is a pretty good idea. I noticed it takes a lot of cpu so adding a sleep(10) in the keep alive whoop is advised. Edited June 24, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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