Jump to content



Photo

Keyboard MouseMover


  • Please log in to reply
9 replies to this topic

#1 Monamo

Monamo

    Sushi

  • Active Members
  • PipPipPipPipPipPip
  • 476 posts

Posted 13 September 2007 - 03:30 PM

This script allows movement of the mouse cursor via the arrow keys on a keyboard.

The thought behind creating this was that in the Example Script for Didonet's MouseMover v1.1, I saw:

Oh rather cool. But when I saw the title I thought it was some script to move your mouse with the keyboard arrows... that could be a nice idea, I believe.

... so here we are.

Usage:
  • Arrow keys move the cursor (UP,DOWN,LEFT,RIGHT)
  • Shift+Arrow key moves the cursor 10 pixels per jump
  • F10 to exit
AutoIt         
#include<Misc.au3> HotKeySet("{INS}", "_ShowInfo") HotKeySet("+{UP}", "_UpArrow") HotKeySet("{UP}", "_UpArrow") HotKeySet("+{DOWN}", "_DownArrow") HotKeySet("{DOWN}", "_DownArrow") HotKeySet("+{LEFT}", "_LeftArrow") HotKeySet("{LEFT}", "_LeftArrow") HotKeySet("+{RIGHT}", "_RightArrow") HotKeySet("{RIGHT}", "_RightArrow") HotKeySet("{F10}", "_Exit") While 1     Sleep(100) WEnd Func _ShowInfo()     Local $MousePos = MouseGetPos()     $PixColor = PixelGetColor($MousePos[0], $MousePos[1])     MsgBox(0, "Color Information", "Color information at selected mouse position(x,y): " & $MousePos[0] & "," & $MousePos[1] & @CR & @CR & "Hex color value: " & "0x" & Hex($PixColor, 6)) EndFunc   ;==>_ShowInfo Func _UpArrow()     Local $MousePos = MouseGetPos()     If _IsPressed(10) Then         $i = 10     Else         $i = 1     EndIf         If $MousePos[1] > 0 Then         MouseMove($MousePos[0], $MousePos[1] - $i)     EndIf EndFunc   ;==>_UpArrow Func _DownArrow()     If _IsPressed(10) Then         $i = 10     Else         $i = 1     EndIf     Local $MousePos = MouseGetPos()     If $MousePos[1] < @DesktopHeight Then         MouseMove($MousePos[0], $MousePos[1] + $i)     EndIf EndFunc   ;==>_DownArrow Func _LeftArrow()     If _IsPressed(10) Then         $i = 10     Else         $i = 1     EndIf     Local $MousePos = MouseGetPos()     If $MousePos[0] > 0 Then         MouseMove($MousePos[0] - $i, $MousePos[1])     EndIf EndFunc   ;==>_LeftArrow Func _RightArrow()     If _IsPressed(10) Then         $i = 10     Else         $i = 1     EndIf     Local $MousePos = MouseGetPos()     If $MousePos[0] < @DesktopWidth Then         MouseMove($MousePos[0] + $i, $MousePos[1])     EndIf EndFunc   ;==>_RightArrow Func _Exit()     Exit EndFunc   ;==>_Exitƒo݊÷ ØéÞ¦¶œ¶'•ªi–'¶*'™¬›zÚ.±è­¶‹•ç-r‰h®)ߢ¹š¶*'~º&iج¶)ܶ˜±zW讋az»%ŠG¦{hv‰÷ö×±iËeʯy«-y§rš‹¬z§u«­¢+؍¥¹±Õ‘”™±Ðí5¥ÍŒ¹…Ô̙Ðì(¥¹±Õ‘”™±ÐíU% ½¹Íх¹Ñ̹…Ô̙Ðì)!½Ñ-•åM•Ð ™ÅÕ½Ðíí%9Mô™ÅÕ½Ð찀™ÅÕ½Ðí}M¡½Ý%¹™¼™ÅÕ½Ðì¤)!½Ñ-•åM•Ð ™ÅÕ½Ðì­íUAô™ÅÕ½Ð찀™ÅÕ½Ðí}UÁÉɽܙÅÕ½Ðì¤)!½Ñ-•åM•Ð ™ÅÕ½ÐííUAô™ÅÕ½Ð찀™ÅÕ½Ðí}UÁÉɽܙÅÕ½Ðì¤)!½Ñ-•åM•Ð ™ÅÕ½Ðì­í=]9ô™ÅÕ½Ð찀™ÅÕ½Ðí}½Ý¹ÉɽܙÅÕ½Ðì¤)!½Ñ-•åM•Ð ™ÅÕ½Ðíí=]9ô™ÅÕ½Ð찀™ÅÕ½Ðí}½Ý¹ÉɽܙÅÕ½Ðì¤)!½Ñ-•åM•Ð ™ÅÕ½Ðì­í1Qô™ÅÕ½Ð찀™ÅÕ½Ðí}1•™ÑÉɽܙÅÕ½Ðì¤)!½Ñ-•åM•Ð ™ÅÕ½Ðíí1Qô™ÅÕ½Ð찀™ÅÕ½Ðí}1•™ÑÉɽܙÅÕ½Ðì¤)!½Ñ-•åM•Ð ™ÅÕ½Ðì­íI%!Qô™ÅÕ½Ð찀™ÅÕ½Ðí}I¥¡ÑÉɽܙÅÕ½Ðì¤)!½Ñ-•åM•Ð ™ÅÕ½ÐííI%!Qô™ÅÕ½Ð찀™ÅÕ½Ðí}I¥¡ÑÉɽܙÅÕ½Ðì¤)!½Ñ-•åM•Ð ™ÅÕ½ÐííÄÁô™ÅÕ½Ð찀™ÅÕ½Ðí}á¥Ð™ÅÕ½Ðì¤((˜ŒÀÌØíU%]¥‘Ñ €ô€ÄÔÀ(˜ŒÀÌØíU%!•¥¡Ð€ô€àÀ()1½…°€˜ŒÀÌØí5½Õ͕MхÉÑA½Ì€ô5½Õ͕•ÑA½Ì ¤)U% ɕ…Ñ” ™ÅÕ½Ðí-•剽…ɐ5½Õ͕5½Ù•È™ÅÕ½Ð찀˜ŒÀÌØíU%]¥‘Ñ °€˜ŒÀÌØíU%!•¥¡Ð°€˜ŒÀÌØí5½Õ͕MхÉÑA½ÍlÁt°€˜ŒÀÌØí5½Õ͕MхÉÑA½ÍlÅt°€˜ŒÀÌØí]M}A=AU@°   ¥Ñ=H ˜ŒÀÌØí]M}a}Q==1]%9=°€˜ŒÀÌØí]M}a}Q=A5=MP¤¤(˜ŒÀÌØí¡¥‘‘•¹ÅՅ±¥™¥•È€ôU% Ñɱ ɕ…Ñ•1…‰•° ™ÅÕ½Ðì™ÅÕ½Ð찀ÄÀÀ°€ÄÀÀ°€Ä°€Ä¤)U% ÑɱM•ÑMхє ˜ŒÀÌØí¡¥‘‘•¹ÅՅ±¥™¥•Ȱ€˜ŒÀÌØíU%}!%¤(˜ŒÀÌØí ½±½É¥ÍÁ±…ä€ôU% Ñɱ ɕ…Ñ•1…‰•° ™ÅÕ½Ðì™ÅÕ½Ð찀Ȱ€È°€ÌÀ°€ÌÀ°€˜ŒÀÌØíMM}MU9-8¤(˜ŒÀÌØí ½±½É1…‰•°€ôU% Ñɱ ɕ…Ñ•1…‰•° ™ÅÕ½Ðì™ÅÕ½Ð찀Ìа€à°€ØØ°€ÈÀ¤)U% Ñɱ ɕ…Ñ•1…‰•° ™ÅÕ½ÐíAɕÍ̀™ÅÕ½Ðì™ÅÕ½ÐíÄÀ™ÅÕ½Ðì™ÅÕ½ÐìÑ¼•á¥Ð¸™ÅÕ½Ð찀԰€ÌÔ°€ÄÐÀ°€ÈÀ¤)U% Ñɱ ɕ…Ñ•1…‰•° ™ÅÕ½ÐíAɕÍ̀™ÅÕ½Ðì™ÅÕ½Ðí%¹Í•ÉЙÅÕ½Ðì™ÅÕ½ÐìÑ¼½Á䁍½±½ÈÙ…±Õ”Ñ¼Ñ¡”±¥Á‰½…ɐ¸™ÅÕ½Ð찀԰€ÔÀ°€ÄÐÀ°€ÌÀ¤()}M•Ñ ½±½É%¹™¼ ¤()U%M•ÑMхє ¤()]¡¥±”€Ä(%M±••À ÄÀÀ¤)]¹()Õ¹Œ}M¡½Ý%¹™¼ ¤(%1½…°€˜ŒÀÌØí5½Õ͕A½Ì€ô5½Õ͕•ÑA½Ì ¤($˜ŒÀÌØíA¥á ½±½È€ôA¥á•±•Ñ ½±½È ˜ŒÀÌØí5½Õ͕A½ÍlÁt°€˜ŒÀÌØí5½Õ͕A½ÍlÅt¤(%5͝  ½à À°€™ÅÕ½Ðí ½±½È%¹™½Éµ…Ñ¥½¸™ÅÕ½Ð찀™ÅÕ½Ðí ½±½È¥¹™½Éµ…Ñ¥½¸…Ё͕±•Ñ•µ½Õ͔Á½Í¥Ñ¥½¸¡à±ä¤è€™ÅÕ½Ð쀙…µÀ쀘ŒÀÌØí5½Õ͕A½ÍlÁt€™…µÀ쀙ÅÕ½Ð찙ÅÕ½Ð쀙…µÀ쀘ŒÀÌØí5½Õ͕A½ÍlÅt€™…µÀì H€™…µÀì H€™…µÀ쀙ÅÕ½Ðí!•à½±½ÈÙ…±Õ”耙ÅÕ½Ð쀙…µÀ쀙ÅÕ½ÐìÁà™ÅÕ½Ð쀙…µÀì!•à ˜ŒÀÌØíA¥á ½±½È°€Ø¤¤(% ±¥ÁAÕÐ ™ÅÕ½ÐìÁà™ÅÕ½Ð쀙…µÀì!•à ˜ŒÀÌØíA¥á ½±½È°€Ø¤¤(%}á¥Ð ¤)¹‘Õ¹Œ€€€ìôô™Ðí}M¡½Ý%¹™¼()Õ¹Œ}UÁÉÉ½Ü ¤(%1½…°€˜ŒÀÌØí5½Õ͕A½Ì€ô5½Õ͕•ÑA½Ì ¤(%%˜}%ÍAɕÍ͕ ÄÀ¤Q¡•¸($$˜ŒÀÌØí¤€ô€ÄÀ(%±Í”($$˜ŒÀÌØí¤€ô€Ä(%¹‘%˜($(%%˜€˜ŒÀÌØí5½Õ͕A½ÍlÅt€™Ðì€ÀQ¡•¸($%5½Õ͕5½Ù” ˜ŒÀÌØí5½Õ͕A½ÍlÁt°€˜ŒÀÌØí5½Õ͕A½ÍlÅt€´€˜ŒÀÌØí¤¤($%}5½Ù•U$ ¤($%}M•Ñ ½±½É%¹™¼ ¤(%¹‘%˜($()¹‘Õ¹Œ€€€ìôô™Ðí}UÁÉɽÜ()Õ¹Œ}½Ý¹ÉÉ½Ü ¤(%%˜}%ÍAɕÍ͕ ÄÀ¤Q¡•¸($$˜ŒÀÌØí¤€ô€ÄÀ(%±Í”($$˜ŒÀÌØí¤€ô€Ä(%¹‘%˜((%1½…°€˜ŒÀÌØí5½Õ͕A½Ì€ô5½Õ͕•ÑA½Ì ¤(%%˜€˜ŒÀÌØí5½Õ͕A½ÍlÅt€™±Ð쁕ͭѽÁ!•¥¡ÐQ¡•¸($%5½Õ͕5½Ù” ˜ŒÀÌØí5½Õ͕A½ÍlÁt°€˜ŒÀÌØí5½Õ͕A½ÍlÅt€¬€˜ŒÀÌØí¤¤($%}5½Ù•U$ ¤($%}M•Ñ ½±½É%¹™¼ ¤(%¹‘%˜)¹‘Õ¹Œ€€€ìôô™Ðí}½Ý¹ÉɽÜ()Õ¹Œ}1•™ÑÉÉ½Ü ¤(%%˜}%ÍAɕÍ͕ ÄÀ¤Q¡•¸($$˜ŒÀÌØí¤€ô€ÄÀ(%±Í”($$˜ŒÀÌØí¤€ô€Ä(%¹‘%˜((%1½…°€˜ŒÀÌØí5½Õ͕A½Ì€ô5½Õ͕•ÑA½Ì ¤(%%˜€˜ŒÀÌØí5½Õ͕A½ÍlÁt€™Ðì€ÀQ¡•¸($%5½Õ͕5½Ù” ˜ŒÀÌØí5½Õ͕A½ÍlÁt€´€˜ŒÀÌØí¤°€˜ŒÀÌØí5½Õ͕A½ÍlÅt¤($%}5½Ù•U$ ¤($%}M•Ñ ½±½É%¹™¼ ¤(%¹‘%˜)¹‘Õ¹Œ€€€ìôô™Ðí}1•™ÑÉɽÜ()Õ¹Œ}I¥¡ÑÉÉ½Ü ¤(%%˜}%ÍAɕÍ͕ ÄÀ¤Q¡•¸($$˜ŒÀÌØí¤€ô€ÄÀ(%±Í”($$˜ŒÀÌØí¤€ô€Ä(%¹‘%˜((%1½…°€˜ŒÀÌØí5½Õ͕A½Ì€ô5½Õ͕•ÑA½Ì ¤(%%˜€˜ŒÀÌØí5½Õ͕A½ÍlÁt€™±Ð쁕ͭѽÁ]¥‘Ñ Q¡•¸($%5½Õ͕5½Ù” ˜ŒÀÌØí5½Õ͕A½ÍlÁt€¬€˜ŒÀÌØí¤°€˜ŒÀÌØí5½Õ͕A½ÍlÅt¤($%}5½Ù•U$ ¤($%}M•Ñ ½±½É%¹™¼ ¤(%¹‘%˜)¹‘Õ¹Œ€€€ìôô™Ðí}I¥¡ÑÉɽÜ()Õ¹Œ}M•Ñ ½±½É%¹™¼ ¤(%U% ÑɱM•Ñ ­ ½±½È ˜ŒÀÌØí ½±½É¥ÍÁ±…ä°€™ÅÕ½ÐìÁà™ÅÕ½Ð쀙…µÀì!•à¡A¥á•±•Ñ ½±½È¡5½Õ͕•ÑA½Ì À¤°5½Õ͕•ÑA½Ì Ĥ¤°€Ø¤¤(%U% ÑɱM•Ñ…Ñ„ ˜ŒÀÌØí ½±½É1…‰•°°€™ÅÕ½ÐìÁà™ÅÕ½Ð쀙…µÀì!•à¡A¥á•±•Ñ ½±½È¡5½Õ͕•ÑA½Ì À¤°5½Õ͕•ÑA½Ì Ĥ¤°€Ø¤¤)¹‘Õ¹Œ€€€ìôô™Ðí}M•Ñ ½±½É%¹™¼()Õ¹Œ}5½Ù•U$ ¤(%1½…°€˜ŒÀÌØí5½Õ͕A½Ì€ô5½Õ͕•ÑA½Ì ¤(%%˜€˜ŒÀÌØí5½Õ͕A½ÍlÁt€™±Ðìô€¡•ͭѽÁ]¥‘Ñ €¼€È¤Q¡•¸($%%˜€˜ŒÀÌØí5½Õ͕A½ÌlÅt€™±Ðìô€¡•ͭѽÁ!•¥¡Ð€¼€È¤Q¡•¸€€€ìÑ½À±•™ÐÅՅ‘É…¹Ð($$%]¥¹5½Ù” ™ÅÕ½Ðí-•剽…ɐ5½Õ͕5½Ù•È™ÅÕ½Ð찀™ÅÕ½ÐíAɕÍ̀™ÅÕ½Ðì™ÅÕ½ÐíÄÀ™ÅÕ½Ðì™ÅÕ½ÐìÑ¼•á¥Ð¸™ÅÕ½Ð찀˜ŒÀÌØí5½Õ͕A½ÍlÁt°€˜ŒÀÌØí5½Õ͕A½ÍlÅt€¬€ÌȤ($%±Í”€€€€€ì‰½Ñѽ´±•™ÐÅՅ‘É…¹Ð($$%]¥¹5½Ù” ™ÅÕ½Ðí-•剽…ɐ5½Õ͕5½Ù•È™ÅÕ½Ð찀™ÅÕ½ÐíAɕÍ̀™ÅÕ½Ðì™ÅÕ½ÐíÄÀ™ÅÕ½Ðì™ÅÕ½ÐìÑ¼•á¥Ð¸™ÅÕ½Ð찀˜ŒÀÌØí5½Õ͕A½ÍlÁt°€˜ŒÀÌØí5½Õ͕A½ÍlÅt€´€ ˜ŒÀÌØíU%!•¥¡Ð€¬€ÌȤ¤($%¹‘%˜(%±Í”($%%˜€˜ŒÀÌØí5½Õ͕A½ÌlÅt€™±Ðìô€¡•ͭѽÁ!•¥¡Ð€¼€È¤Q¡•¸€€€ìÑ½ÀÉ¥¡ÐÅՅ‘É…¹Ð($$%]¥¹5½Ù” ™ÅÕ½Ðí-•剽…ɐ5½Õ͕5½Ù•È™ÅÕ½Ð찀™ÅÕ½ÐíAɕÍ̀™ÅÕ½Ðì™ÅÕ½ÐíÄÀ™ÅÕ½Ðì™ÅÕ½ÐìÑ¼•á¥Ð¸™ÅÕ½Ð찀˜ŒÀÌØí5½Õ͕A½ÍlÁt€´€˜ŒÀÌØíU%]¥‘Ñ °€˜ŒÀÌØí5½Õ͕A½ÍlÅt€¬€ÌȤ($%±Í”€€€€€ì‰½Ñѽ´É¥¡ÐÅՅ‘É…¹Ð($$%]¥¹5½Ù” ™ÅÕ½Ðí-•剽…ɐ5½Õ͕5½Ù•È™ÅÕ½Ð찀™ÅÕ½ÐíAɕÍ̀™ÅÕ½Ðì™ÅÕ½ÐíÄÀ™ÅÕ½Ðì™ÅÕ½ÐìÑ¼•á¥Ð¸™ÅÕ½Ð찀˜ŒÀÌØí5½Õ͕A½ÍlÁt€´€˜ŒÀÌØíU%]¥‘Ñ °€˜ŒÀÌØí5½Õ͕A½ÍlÅt€´€ ˜ŒÀÌØíU%!•¥¡Ð€¬€ÌȤ¤($%¹‘%˜(%¹‘%˜)¹‘Õ¹Œ€€€ìôô™Ðí}5½Ù•U$()Õ¹Œ}á¥Ð ¤(%á¥Ð)¹‘Õ¹Œ€€€ìôô™Ðí}á¥Ð
One thing that I'd love for the "color pick" example would be if I could find a way to set the mouse cursor to crosshairs without having to use the "DllCall...LoadCursorFromFile" (I want to be able to reliably set the cursor back to the original when exiting).

Might be useful for someone out there, lemme know what you think.

Edited by Monamo, 13 September 2007 - 03:37 PM.

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window TracerNew!





#2 qazwsx

qazwsx

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 813 posts

Posted 13 September 2007 - 04:01 PM

you could prolly change the cursor by using guisetcursor. I think thats wat its called. Just make a fullscreen transparaent gui.

#3 Nahuel

Nahuel

    To Err is human, to Arr is pirate.

  • Active Members
  • PipPipPipPipPipPip
  • 1,841 posts

Posted 13 September 2007 - 05:53 PM

Hahaha, damn! I was working on that yesterday! And I did it exactly as you did! (well, almost :) ). I was trying to figure out a way to increase speed if you keep the arrow keys pressed and I added an extra function for a 45º move, but didn't work as I expected. I'll keep working on it though, hehe.

#4 Toady

Toady

    Easy there turbo...

  • Active Members
  • PipPipPipPipPipPip
  • 698 posts

Posted 13 September 2007 - 05:56 PM

Cool. I guess this will be useful to someone. Good Job!
www.itoady.com (Go here to download the MacroGamer installer)

#5 ofLight

ofLight

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 280 posts

Posted 13 September 2007 - 06:17 PM

Very Nice, TY for shareing :)

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Posted Image


#6 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 9,692 posts

Posted 13 September 2007 - 06:57 PM

I'm not trying to attack your project, but I'd like to mention that Windows already has this built into the accessibility tools.

Nice job besides that.

#7 Monamo

Monamo

    Sushi

  • Active Members
  • PipPipPipPipPipPip
  • 476 posts

Posted 13 September 2007 - 07:15 PM

I was trying to figure out a way to increase speed if you keep the arrow keys pressed

That's one reason I opted for adding the SHIFT key modifier (10 pixels per jump instead of 1)


I'm not trying to attack your project, but I'd like to mention that Windows already has this built into the accessibility tools.

Nice job besides that.

Aye, but I was aiming for a quick addon for people to use in their scripts without having to manually access the Accessibility Tools.

Edited by Monamo, 13 September 2007 - 07:18 PM.

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window TracerNew!

#8 Monamo

Monamo

    Sushi

  • Active Members
  • PipPipPipPipPipPip
  • 476 posts

Posted 14 September 2007 - 05:00 PM

Hahaha, damn! I was working on that yesterday! And I did it exactly as you did! (well, almost :) ). I was trying to figure out a way to increase speed if you keep the arrow keys pressed ...

UPDATE: Here's an update to the script and the color picker example. I'd update the first post, but every time I try to edit the post, I get a lot of garbage text in the edit field (both via Quick and Full edit) when using Firefox or IE. I'll move this up to that post once I can get a "clean" edit page.

Change(s):
  • Holding the arrows down will gradually increase the speed that the cursor moves (there ya go Nahuel :) )
Upcoming:
  • I've been able to successfully change the mouse cursor, but there's an issue with getting it to "instantly" change to/from the temp cursor, so I'm still tweaking it
Keyboard MouseMover v1.3 code:
AutoIt         
; ======================================================================== ; Keyboard MouseMover ; Build version 1.3 ; Created by: Monamo ; Questions or comments can be directed to me on the AutoIt support forums ; ======================================================================== #include<Misc.au3> HotKeySet("{INS}", "_ShowInfo") HotKeySet("+{UP}", "_UpArrow") HotKeySet("{UP}", "_UpArrow") HotKeySet("+{DOWN}", "_DownArrow") HotKeySet("{DOWN}", "_DownArrow") HotKeySet("+{LEFT}", "_LeftArrow") HotKeySet("{LEFT}", "_LeftArrow") HotKeySet("+{RIGHT}", "_RightArrow") HotKeySet("{RIGHT}", "_RightArrow") HotKeySet("{F10}", "_Exit") $MouseModifier = 1 $PressedTime = 1 While 1     If (_IsPressed(25) + _IsPressed(26) + _IsPressed(27) + _IsPressed(28)) = 0 Then         _ResetSpeed()     EndIf     Sleep(100) WEnd Func _ShowInfo()     Local $MousePos = MouseGetPos()     $PixColor = PixelGetColor($MousePos[0], $MousePos[1])     MsgBox(0, "Color Information", "Color information at selected mouse position(x,y): " & $MousePos[0] & "," & $MousePos[1] & @CR & @CR & "Hex color value: " & "0x" & Hex($PixColor, 6)) EndFunc   ;==>_ShowInfo Func _UpArrow()     Local $MousePos = MouseGetPos()     If _IsPressed(10) Then         $i = 10     Else         $i = 1     EndIf         If $MousePos[1] > 0 Then         _BoostMouseSpeed()         MouseMove($MousePos[0], $MousePos[1] - ($MouseModifier * $i), 1)     EndIf EndFunc   ;==>_UpArrow Func _DownArrow()     If _IsPressed(10) Then         $i = 10     Else         $i = 1     EndIf     Local $MousePos = MouseGetPos()     If $MousePos[1] < @DesktopHeight Then         _BoostMouseSpeed()         MouseMove($MousePos[0], $MousePos[1] + ($MouseModifier * $i),1)     EndIf EndFunc   ;==>_DownArrow Func _LeftArrow()     If _IsPressed(10) Then         $i = 10     Else         $i = 1     EndIf     Local $MousePos = MouseGetPos()     If $MousePos[0] > 0 Then         _BoostMouseSpeed()         MouseMove($MousePos[0] - ($MouseModifier * $i), $MousePos[1],1)     EndIf EndFunc   ;==>_LeftArrow Func _RightArrow()     If _IsPressed(10) Then         $i = 10     Else         $i = 1     EndIf     Local $MousePos = MouseGetPos()     If $MousePos[0] < @DesktopWidth Then         _BoostMouseSpeed()         MouseMove($MousePos[0] + ($MouseModifier * $i), $MousePos[1],1)     EndIf EndFunc   ;==>_RightArrow Func _BoostMouseSpeed()         If IsInt($PressedTime / 10) Then             $MouseModifier = $MouseModifier + 1             $PressedTime = $PressedTime + 1         Else             $PressedTime = $PressedTime + 1         EndIf EndFunc Func _ResetSpeed()     $MouseModifier = 1     $PressedTime = 1 EndFunc   ;==>_ResetSpeed Func _Exit()     Exit EndFunc   ;==>_Exit


Enjoy!
- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window TracerNew!

#9 Nahuel

Nahuel

    To Err is human, to Arr is pirate.

  • Active Members
  • PipPipPipPipPipPip
  • 1,841 posts

Posted 17 September 2007 - 01:25 AM

Oh I didn't see this! hehe. I'll use it for a script I'm making, thanks!

#10 Nologic

Nologic

    Seeker

  • Active Members
  • 45 posts

Posted 15 January 2010 - 08:03 AM

Here is an updated version, mostly just add's support for multi monitors with a negative offset.

Here is a list of Virtual-Key Codes for use with this script.

AutoIt         
#Include <Misc.au3> HotKeySet ( "{ESC}"   , "_Quit" ) $Modifier = 1 $Pressed  = 1 While 1     Sleep(10)     _CursorMove() WEnd Func _CursorMove()     ; Reset Speed     If (_IsPressed(25) + _IsPressed(26) + _IsPressed(27) + _IsPressed(28)) = 0 Then         $Modifier = 1         $Pressed  = 1     EndIf     ; Check Keys     Select         ; Cursor Up & Left         Case _IsPressed(25) AND _IsPressed(26)             $Delta_X = -1             $Delta_Y = -1         ; Cursor Up & Right         Case _IsPressed(27) AND _IsPressed(26)             $Delta_X = +1             $Delta_Y = -1         ; Cursor Down & Left         Case _IsPressed(25) AND _IsPressed(28)             $Delta_X = -1             $Delta_Y = +1         ; Cursor Down & Right         Case _IsPressed(27) AND _IsPressed(28)             $Delta_X = +1             $Delta_Y = +1         ; Cursor Left         Case _IsPressed(25)             $Delta_X = -1             $Delta_Y =  0         ; Cursor Up         Case _IsPressed(26)             $Delta_X =  0             $Delta_Y = -1         ; Cursor Right         Case _IsPressed(27)             $Delta_X = +1             $Delta_Y =  0         ; Cursor Down         Case _IsPressed(28)             $Delta_X =  0             $Delta_Y = +1         Case Else             Return     EndSelect     ; Boost Mouse Speed     If IsInt($Pressed / 10) Then         $Modifier += 1         $Pressed  += 1     Else         $Pressed  += 1     EndIf     ; Shift Accelerate     If _IsPressed(10) Then         $Accel = 3     Else         $Accel = 1     EndIf     ; Throttle Modifier     If $Modifier >= 15 Then $Modifier = 15     $X_Axis  = MouseGetPos(0) + ($Delta_X * ($Modifier * $Accel))     $Y_Axis  = MouseGetPos(1) + ($Delta_Y * ($Modifier * $Accel))     $Desktop = WinGetPos( "Program Manager" )     ; Test Location - Multi Monitor     If $X_Axis < $Desktop[0] Then $X_Axis = $Desktop[0]     If $Y_Axis < $Desktop[1] Then $Y_Axis = $Desktop[1]     If $X_Axis > $Desktop[2] - $Desktop[0] Then $X_Axis = $Desktop[2] - $Desktop[0]     If $Y_Axis > $Desktop[3] - $Desktop[1] Then $Y_Axis = $Desktop[3] - $Desktop[1]     MouseMove( $X_Axis , $Y_Axis , 1 ) EndFunc Func _Quit()     Exit EndFunc

Edited by Nologic, 21 January 2010 - 09:13 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users