Jump to content

Keyboard MouseMover


Monamo
 Share

Recommended Posts

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
#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   ;==>_ExitoÝ÷ ØéÞ¦¶¶'ªi'¶*'¬zÚ.±è­¶ç-rh®)ߢ¹¶*'~º&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

- 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 Tracer[sup]New![/sup]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

- 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 Tracer[sup]New![/sup]

Link to comment
Share on other sites

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:

; ========================================================================
; 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 Tracer[sup]New![/sup]

Link to comment
Share on other sites

  • 2 years later...

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.

#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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...