AzKay Posted July 25, 2006 Share Posted July 25, 2006 Is there a function, like MouseMove() Except, one that, moves, for example, instead of X & Y You just tell it how far to move, either left or right, so, If I press the "left arrow" key on the keyboard [ _IsPressed ] It would move the mouse, just a littlebit, if Im holding the arrow button, it doesnt stop moving left, you get what I mean? # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
/dev/null Posted July 25, 2006 Share Posted July 25, 2006 Is there a function, like MouseMove() Except, one that, moves, for example, instead of X & Y You just tell it how far to move, either left or right, so, If I press the "left arrow" key on the keyboard [ _IsPressed ] It would move the mouse, just a littlebit, if Im holding the arrow button, it doesnt stop moving left, you get what I mean? Use MouseGetPos() to retrieve the current position of the mouse cursor and then just add a few pixels to the x or y coordinate and set that new value with MouseMove(). $pos = MouseGetPos() $x = $pos[0] $y = $pos[1] MouseMove($x + 10,$y) BTW: Use HotKeySet() to trap the "left arrow" key and set the new mouse position within the "hotkey function". Cheers Kurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
AzKay Posted July 25, 2006 Author Share Posted July 25, 2006 Ah, thanks # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted July 25, 2006 Author Share Posted July 25, 2006 Hmm, I need it to be "constant" when im holding it down, but it moves/pauses/moves/pauses Any way to make it keep moving until I let go? # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted July 25, 2006 Author Share Posted July 25, 2006 (edited) Hmm, I need it to be "constant" when im holding it down, but it moves/pauses/moves/pauses Any way to make it keep moving until I let go?I just tryed it with _IsPressed, to see if it would make a difference, but, It doesnt do anything, atall. For some reason, the last couple of times ive tryed using IsPressed, nothings been happening.Nevermind, found out why, Ive been using 0x27 instead of "27" Edited July 25, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted July 25, 2006 Author Share Posted July 25, 2006 Hmm, the response time isnt too good xP # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
/dev/null Posted July 26, 2006 Share Posted July 26, 2006 Hmm, the response time isnt too good xP Try this: #include <Misc.au3> AdlibEnable("MoveTheMouse", 50) HotKeySet("{ESC}", "TheEnd") Global $left_arrow_pressed Global $mouse_step_x = 3 ; pixels per move !! ;;;; Body of program would go here;;;; While 1 Sleep(50) If _IsPressed("25") Then $left_arrow_pressed = 1 Else $left_arrow_pressed = 0 EndIf WEnd ;;;;;;;; Func MoveTheMouse() If $left_arrow_pressed = 1 Then $pos = MouseGetPos() $x = $pos[0] $y = $pos[1] MouseMove($x - $mouse_step_x, $y, 0) EndIf EndFunc ;==>MoveTheMouse Func TheEnd() Exit EndFunc ;==>TheEnd Cheers Kurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
AzKay Posted July 26, 2006 Author Share Posted July 26, 2006 Does basically, the same as mine: #include <Misc.au3> While 1 If _IsPressed("27") Then $posRight = MouseGetPos() $xRight = $posRight[0] $yRight = $posRight[1] MouseMove($xRight + 150,$yRight) EndIf If _IsPressed("25") Then $posLeft = MouseGetPos() $xLeft = $posLeft[0] $yLeft = $posLeft[1] MouseMove($xLeft - 150,$yLeft) EndIf WEnd # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
/dev/null Posted July 26, 2006 Share Posted July 26, 2006 (edited) Does basically, the same as mine:Nope! Did you try it? It moves the mouse ways more smoothly than yours.EDIT: you can adjust the behaviour by changing $mouse_step_x and the speed of MouseMove().CheersKurt Edited July 26, 2006 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
AzKay Posted July 26, 2006 Author Share Posted July 26, 2006 Then, Ill try adjust it, Because, for me, it went, worse then mine, if I pressed it really quick, it kinda, spassed out other 2 pixels xD # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted July 26, 2006 Author Share Posted July 26, 2006 (edited) Then, Ill try adjust it, Because, for me, it went, worse then mine, if I pressed it really quick, it kinda, spassed out other 2 pixels xDWait, I think it was running at the same time as the other one ^^; EDIT:: Hmm, I added in a "right" move too, but now, only right works, left doesnt.. expandcollapse popup#include <Misc.au3> AdlibEnable("_Left", 50) AdlibEnable("_Right", 50) HotKeySet("{ESC}", "TheEnd") Global $left_arrow_pressed Global $right_arrow_pressed Global $mouse_step_x = 100 ; pixels per move !! ;;;; Body of program would go here;;;; While 1 Sleep(50) If _IsPressed("25") Then $left_arrow_pressed = 1 Else $left_arrow_pressed = 0 EndIf If _IsPressed("27") Then $right_arrow_pressed = 1 Else $right_arrow_pressed = 0 EndIf WEnd ;;;;;;;; Func _Left() If $left_arrow_pressed = 1 Then $posLeft = MouseGetPos() $xLeft = $posLeft[0] $yLeft = $posLeft[1] MouseMove($xLeft - $mouse_step_x, $yLeft, 0) EndIf EndFunc ;==>MoveTheMouse Func _Right() If $right_arrow_pressed = 1 Then $posRight = MouseGetPos() $xRight = $posRight[0] $yRight = $posRight[1] MouseMove($xRight + $mouse_step_x, $yRight, 0) EndIf EndFunc ;==>MoveTheMouse Func TheEnd() Exit EndFunc ;==>TheEnd Edited July 26, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
/dev/null Posted July 26, 2006 Share Posted July 26, 2006 Wait, I think it was running at the same time as the other one ^^; EDIT:: Hmm, I added in a "right" move too, but now, only right works, left doesnt.. AdlibEnable can only run one function. Do this: AdlibEnable("_MoveMouse", 50) Func _MoveMouse() _Left() _Right() EndFunc Cheers Kurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
AzKay Posted July 26, 2006 Author Share Posted July 26, 2006 Thanks # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Paulie Posted July 26, 2006 Share Posted July 26, 2006 This can smooth things out if you hold in the button If _Ispressed("27") Then ;Left or right? While _IsPressed("27") $pos= MouseGetPos() MouseMove($pos[0]+10, $pos[1]) Wend Endif Smooth for me 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