我单击转发按钮它会发送字符串,但我不能使用 winform 发送字符串给它来修改它
我发现罗技有G 系列 Lua API
我尝试使用 OnEvent 函数来控制鼠标点击发送字符串
但我以前从来没有Lua。
这是我的 C# 代码
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using LuaInterface;
namespace LuaScript
{
public partial class Form1 : Form
{
public Lua lua = new Lua();
string var = "aabbcc";
public Form1()
{
InitializeComponent();
lua.DoFile("logitechSendString.lua");
object[] objs = lua.GetFunction("OnEvent").Call(this, var);
lua.Close();
}
}
}
我的lua代码
function OnEvent(event, arg)
if (arg!=null)then
PressKey(arg)
ReleaseKey(arg)
Sleep(50)
PressMouseButton("Forward")
ReleaseMouseButton("Forward")
end
end
但它符合错误
System.IO.FileLoadException
HResult=0x80131621
Message=Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
Source=LuaInterface
StackTrace:
LuaInterface.Lua..ctor()
LuaScript.Form1..ctor() D:\Visual Studio\LuaScript\LuaScript\Form1.cs: 15
LuaScript.Program.Main() D:\Visual Studio\LuaScript\LuaScript\Program.cs:19
如何解决这个错误?
以及如何使用lua控制鼠标?
谢谢