使用Sendinput方法时可以控制鼠标指针的速度吗?控制sendinput鼠标移动速度
例如,这是我的代码:
public static void ClickMouseDOWN(int x, int y)
{
INPUT mouseInput = new INPUT();
mouseInput.type = (int)InputType.INPUT_MOUSE;
mouseInput.mi.dx = CalculateAbsoluteCoordinateX(x);
mouseInput.mi.dy = CalculateAbsoluteCoordinateY(y);
mouseInput.mi.mouseData = 0;
// mouse teleports instantly
mouseInput.mi.dwFlags = (int)MOUSEEVENTF.MOVE | (int)MOUSEEVENTF.ABSOLUTE;
SendInput(1, new INPUT[] { mouseInput }, Marshal.SizeOf(mouseInput));
// mouse teleports instantly
mouseInput.mi.dwFlags = (int)MOUSEEVENTF.LEFTDOWN;
SendInput(1, new INPUT[] { mouseInput }, Marshal.SizeOf(mouseInput));
}
下面的代码执行MouseMovement +鼠标键按(下)命令,但问题是,在位置的指针传送点(INT X,int y)对代替以一定的速度移动到它。
我希望能够控制这个速度。
不知道有多少点但你需要一个定时器来多次调用SendInput()来设置光标的动画。不要期望用户弄乱它并故意移动鼠标。好吧,我会的。 –