erifash Posted January 4, 2005 Share Posted January 4, 2005 Do you have a sticky, ball-type mouse? This could be useful for those who aren't privelaged enough to have an optical mouse. Plus, it's just plain cool! Here's the code:Thanks to ezzetabi for the _IsPressed fuction!Use the arrow keys to move, the numpad selects the speed setting, F1 left clicks (hold it down to drag), F2 right clicks (hold it down to drag), and control+F11 exits.expandcollapse popupOpt("TrayIconHide", 1) HotkeySet("{UP}", "n") HotkeySet("{DOWN}", "s") HotkeySet("{RIGHT}", "e") HotkeySet("{LEFT}", "w") HotkeySet("{F1}", "none") HotkeySet("{F2}", "none") HotKeySet("{NUMPAD1}", "sp1") HotKeySet("{NUMPAD2}", "sp2") HotKeySet("{NUMPAD3}", "sp3") HotKeySet("{NUMPAD4}", "sp4") HotKeySet("{NUMPAD5}", "sp5") HotKeySet("{NUMPAD6}", "sp6") HotKeySet("{NUMPAD7}", "sp7") HotKeySet("{NUMPAD8}", "sp8") HotKeySet("{NUMPAD9}", "sp9") HotkeySet("^{F11}", "myexit") $sp = 20 $left = "up" $right = "up" While 1 Sleep(10) If _IsPressed('70') = 1 and $left = "up" Then $left = "down" MouseDown("left") EndIf If _IsPressed('70') = 0 and $left = "down" Then $left = "up" MouseUp("left") EndIf If _IsPressed('71') = 1 and $right = "up" Then $right = "down" MouseDown("right") EndIf If _IsPressed('71') = 0 and $right = "down" Then $right = "up" MouseUp("right") EndIf Wend Func myexit() Exit EndFunc Func none() EndFunc Func _IsPressed($hexKey) ; $hexKey must be the value of one of the keys. ; _IsPressed will return 0 if the key is not pressed, 1 if it is. Local $aR, $bRv;$hexKey $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) ;If $aR[0] = -32767 Then If $aR[0] <> 0 Then $bRv = 1 Else $bRv = 0 EndIf Return $bRv EndFunc ;==>_IsPressed Func n() $pos = MouseGetPos() MouseMove($pos[0], $pos[1] - $sp, 1) EndFunc Func s() $pos = MouseGetPos() MouseMove($pos[0], $pos[1] + $sp, 1) EndFunc Func e() $pos = MouseGetPos() MouseMove($pos[0] + $sp, $pos[1], 1) EndFunc Func w() $pos = MouseGetPos() MouseMove($pos[0] - $sp, $pos[1], 1) EndFunc Func leftc() $pos = MouseGetPos() MouseClick("left", $pos[0], $pos[1], 1, 1) EndFunc Func rightc() $pos = MouseGetPos() MouseClick("right", $pos[0], $pos[1], 1, 1) EndFunc Func sp1() $sp = 1 EndFunc Func sp2() $sp = 5 EndFunc Func sp3() $sp = 10 EndFunc Func sp4() $sp = 15 EndFunc Func sp5() $sp = 20 EndFunc Func sp6() $sp = 30 EndFunc Func sp7() $sp = 50 EndFunc Func sp8() $sp = 70 EndFunc Func sp9() $sp = 100 EndFuncAny questions/comments would be greatly appreciated! My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver Link to comment Share on other sites More sharing options...
Insolence Posted January 5, 2005 Share Posted January 5, 2005 Excellent idea, very interesting "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
layer Posted January 5, 2005 Share Posted January 5, 2005 sounds just like a dllcall... , but great work! FootbaG Link to comment Share on other sites More sharing options...
datkewlguy Posted January 5, 2005 Share Posted January 5, 2005 great work, good program, whered you get such a brilliant idea? Link to comment Share on other sites More sharing options...
sugi Posted January 5, 2005 Share Posted January 5, 2005 From Microsoft. IIRC every windows from Win98+ has this function builtin. Link to comment Share on other sites More sharing options...
this-is-me Posted January 5, 2005 Share Posted January 5, 2005 Yep, It's in the accessability options in the control panel. Who else would I be? Link to comment Share on other sites More sharing options...
pcdestroyer Posted January 5, 2005 Share Posted January 5, 2005 nice hehe i already wrong a script like that... it was long time ago .. Link to comment Share on other sites More sharing options...
Ktulu789 Posted January 28, 2007 Share Posted January 28, 2007 (edited) Wow, the option to select the speed is really nice. This is really better than Microsoft's. The only thing I complain is that you can't move diagonally. But the script can be changed so the speed is selected with the alfanumeric numbers (or the Function keys) and the direction is selected with the Numeric keypad. The buttons are simple to use, not as MS's that you have to remember wether you pressed "0", then just release it with a ".". I'll be working in the modifications if you are OK with it, all credits to you of course! :-D Cheers, Lucas. Edited January 28, 2007 by Ktulu789 AutoIt is a blessing, I don't know how I was able to use my computer before [Auto]It :-S Link to comment Share on other sites More sharing options...
sandman Posted January 28, 2007 Share Posted January 28, 2007 How do you turn it off? Uh.... just wondering. [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center] Link to comment Share on other sites More sharing options...
Achilles Posted January 28, 2007 Share Posted January 28, 2007 How do you turn it off?Uh.... just wondering.HotkeySet("^{F11}", "myexit") My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Infinitex0 Posted January 29, 2007 Share Posted January 29, 2007 hmmmmmmmmmmmm, this has already been done.............a while ago though. The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] 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