可以用微软自带的辅助功能选项实现
用au3的话,如下:HotKeySet("{ESC}", "Terminate")
HotKeySet("#{LEFT}", "ZuoYi")
HotKeySet("#{RIGHT}", "YouYi")
HotKeySet("#{UP}", "ShangYi")
HotKeySet("#{DOWN}", "XiaYi")
HotKeySet("#!{LEFT}", "ZuoJi")
HotKeySet("#!{RIGHT}", "YouJi")
Local $dll = DllOpen("user32.dll")
While 1
Sleep(100)
WEnd
Func ZuoYi()
me(1,-5)
EndFunc
Func YouYi()
me(1,5)
EndFunc
Func ShangYi()
me(1,0,-5)
EndFunc
Func XiaYi()
me(1,0,5)
EndFunc
Func ZuoJi()
me(2)
me(4)
EndFunc
Func YouJi()
Sleep(200)
me(8)
me(16)
EndFunc
Func me($Flags, $X = 0, $Y = 0, $Data = 0, $ExtraInfo = 0)
DllCall($dll, "none", "mouse_event", "dword", $Flags, "dword", $X, "dword", $Y, "dword", $Data, "ulong_ptr", $ExtraInfo)
EndFunc
Func Terminate()
Exit 0
DllClose($dll)
EndFunc
#cs
$Flags值:
鼠标移动 1
左键按下 2
左键释放 4
右键按下 8
右键释放 16
中键按下 32
中键释放 64
滚轮移动 2048
X 键按下 128
X 键释放 256
#ce
|