我正在尝试使用一个名为rustdesk的远程桌面软件来玩游戏,我已经创建了一个脚本,可以将鼠标水平地移动360度,但是一旦鼠标从左到右,游戏中的角色也会移动,所以如何在没有看到沙司桌上的变化的情况下移动MoveMouse。
这是代码:
#Persistent
SetTimer, check, -100
return
check(){
If edge("left")
{
MouseMove, 1718, 490, 0
}
else if edge("right")
{
MouseMove, 0, 490, 0
}
; ...
SetTimer, check, -100
}
edge(pos){
SysGet, VirtualWidth, 78
SysGet, VirtualHeight, 79
T := 10
CoordMode, Mouse, Screen
MouseGetPos, mX, mY
left := (mX < T)
top := (mY < T)
right := (mX > VirtualWidth - T)
bottom := (mY > VirtualHeight - T)
If (pos = "left")
return left
else if (pos = "top")
return top
else if (pos = "right")
return right
else if (pos = "bottom")
return bottom
}I tried using BlockInput but it completely stops the mouse.发布于 2022-10-30 15:18:32
要阻止键盘输入,可以尝试
#NoEnv
ListLines Off
SetBatchLines -1
#KeyHistory 0
Process, Priority,, H
#Persistent
SetTimer, check, -100
return
Critical
check(){
If edge("left")
{
BlockKeyboard("On")
MouseMove, 1718, 490, 0
BlockKeyboard("Off")
}
else if edge("right")
{
BlockKeyboard("On")
MouseMove, 0, 490, 0
BlockKeyboard("Off")
}
SetTimer, check, -100
}
edge(pos){
SysGet, VirtualWidth, 78
SysGet, VirtualHeight, 79
T := 10
CoordMode, Mouse, Screen
MouseGetPos, mX, mY
left := (mX < T)
top := (mY < T)
right := (mX > VirtualWidth - T)
bottom := (mY > VirtualHeight - T)
If (pos = "left")
return left
else if (pos = "top")
return top
else if (pos = "right")
return right
else if (pos = "bottom")
return bottom
}
BlockKeyboard(state){
Loop, 512
{
Key := Format("SC{:X}",A_Index)
If (state = "On")
Hotkey, *%Key%, KeyboardKey, On UseErrorLevel
else
Hotkey, *%Key%, KeyboardKey, Off UseErrorLevel
}
KeyboardKey:
return
}https://stackoverflow.com/questions/74247447
复制相似问题