原来这样可以。#include <Misc.au3>
HotKeySet("{home}","UUU")
HotKeySet("{end}","UUU")
HotKeySet("{w}","UUU")
HotKeySet("{s}","UUU")
HotKeySet("{a}","UUU")
HotKeySet("{d}","UUU")
Local $dll = DllOpen("user32.dll")
While 1
Sleep(50)
If _IsPressed("57", $dll) Then;W,上
$i = 10
$mousepos = MouseGetPos()
$mx = $mousepos[0]
$my = $mousepos[1]
While _IsPressed("57", $dll)
MouseMove($mx, $my - $i)
$i += 10
WEnd
ElseIf _IsPressed("53", $dll) Then;S,下
$i = 10
$mousepos = MouseGetPos()
$mx = $mousepos[0]
$my = $mousepos[1]
While _IsPressed("53", $dll)
MouseMove($mx, $my + $i)
$i += 10
WEnd
ElseIf _IsPressed("41", $dll) Then;A,左
$i = 10
$mousepos = MouseGetPos()
$mx = $mousepos[0]
$my = $mousepos[1]
While _IsPressed("41", $dll)
MouseMove($mx - $i, $my)
$i += 10
WEnd
ElseIf _IsPressed("44", $dll) Then;D,右
$i = 10
$mousepos = MouseGetPos()
$mx = $mousepos[0]
$my = $mousepos[1]
While _IsPressed("44", $dll)
MouseMove($mx + $i, $my)
$i += 10
WEnd
ElseIf _IsPressed("24", $dll) Then;HOME,点击左键
MouseClick("left")
ElseIf _IsPressed("23", $dll) Then;END,点击右键
MouseClick("right")
EndIf
WEnd
DllClose($dll)
Func uuu()
EndFunc
|