Saturn.32 Guest
|
Posted: Thu Aug 21, 2008 10:07 pm Post subject: Simulating Mouse movements |
|
|
I'm trying to create a script that would allow me to move my mouse pointer with the arrow keys on my keyboard.
This is what I have so far, from what I can tell it should work but it dosn't.
| Code: | ;######################################################################################
;######################################################################################
;######################################################################################
;
;
; <COMPILER: v1.0.46.7>
Process, Priority, , High
;
Numlock::
Suspend
Var:=!Var ; Toggles between 0 and 1
If Var
{
SoundBeep, 200, 500
}
Else
SoundBeep,1000 , 500
Return
;
;######################################################################################
;######################################################################################
;######################################################################################
;
Down = 1
$*~Down::
getkeystate, state, Down
if state = D
Loop
{
sleep, 15
DllCall("Mouse_Event", uint, 1, int, 0, int, Down , uint,0, int,0 )
sleep, 15
getkeystate, state, Down
if state = U
break
}
Return
;
;######################################################################################
;######################################################################################
;######################################################################################
;
Up = 1
$*~Up::
getkeystate, state, Up
if state = D
Loop
{
sleep, 15
DllCall("Mouse_Event", uint, 1, int, 0, int, Up , uint,0, int,0 )
sleep, 15
getkeystate, state, Up
if state = U
break
}
Return
;
;######################################################################################
;######################################################################################
;######################################################################################
;
Left = 1
$*~Left::
getkeystate, state, Left
if state = D
Loop
{
sleep, 15
DllCall("Mouse_Event", uint, 1, int, 0, int, Left , uint,0, int,0 )
sleep, 15
getkeystate, state, Left
if state = U
break
}
Return
;
;######################################################################################
;######################################################################################
;######################################################################################
;
Right = 1
$*~Right::
getkeystate, state, Right
if state = D
Loop
{
sleep, 15
DllCall("Mouse_Event", uint, 1, int, 0, int, Right , uint,0, int,0 )
sleep, 15
getkeystate, state, Right
if state = U
break
}
Return
;
;######################################################################################
;######################################################################################
;######################################################################################
|
|
|