Files
better-genshin-impact/Fischless.WindowsInput/WindowsInputMessageDispatcher.cs
辉鸭蛋 7853901137 log text optimization
文本优化(战斗策略文件不存在、sendInput被拦截、路径追踪中战斗策略日志打印修改)
2025-01-09 23:58:28 +08:00

28 lines
827 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Runtime.InteropServices;
using Vanara.PInvoke;
namespace Fischless.WindowsInput;
internal class WindowsInputMessageDispatcher : IInputMessageDispatcher
{
public void DispatchInput(User32.INPUT[] inputs)
{
if (inputs == null)
{
throw new ArgumentNullException(nameof(inputs));
}
if (inputs.Length == 0)
{
throw new ArgumentException("The input array was empty", nameof(inputs));
}
uint num = User32.SendInput((uint)inputs.Length, inputs, Marshal.SizeOf(typeof(User32.INPUT)));
if (num != (ulong)(long)inputs.Length)
{
throw new Exception("模拟键鼠消息发送失败常见原因1.你未以管理员权限运行程序2.存在安全软件拦截比如360");
}
}
}