Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Lua Logitech脚本,按住键直到释放_Lua_Scripting_Logitech_Logitech Gaming Software - Fatal编程技术网

Lua Logitech脚本,按住键直到释放

Lua Logitech脚本,按住键直到释放,lua,scripting,logitech,logitech-gaming-software,Lua,Scripting,Logitech,Logitech Gaming Software,是否可以使Logitech脚本以字母为目标 例如>F 使用鼠标按钮5如果我想让这个logitech脚本按住F键直到松开鼠标按钮5我该怎么做 function OnEvent(event, arg) if event == "MOUSE_BUTTON_RELEASED" and arg == 5 then PressAndReleaseMouseButton(5); end 但是,您也可以不编写脚本就执行相同的操作。 只需通过简单的拖放将键F绑定到鼠标按钮5上。欢迎使用SO-请参见-如何创

是否可以使Logitech脚本以字母为目标

例如>F

使用鼠标按钮
5
如果我想让这个logitech脚本按住
F
键直到松开鼠标按钮
5
我该怎么做

function OnEvent(event, arg)

if event == "MOUSE_BUTTON_RELEASED" and arg == 5 then

PressAndReleaseMouseButton(5);

end
但是,您也可以不编写脚本就执行相同的操作。

只需通过简单的拖放将键
F
绑定到鼠标按钮5上。

欢迎使用SO-请参见-如何创建一个最小的、可复制的示例当提出问题时,如果您提供他们可以轻松理解并用于复制问题的代码,人们将能够更好地提供帮助。这被称为创建一个最小的、可复制的示例(reprex)、一个最小的、完整的和可验证的示例(mcve)或一个最小的、可操作的示例(mwe)。-你提供的代码确实会按下它,但是在我使用的游戏中,它不会像上面的代码那样抑制/释放working@damian-在原始代码中,按鼠标按钮(1)键按code>和
释放鼠标按钮(1)使用
释放键(“G”)
function OnEvent(event, arg)
   if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
      PressKey("F")
   end
   if event == "MOUSE_BUTTON_RELEASED" and arg == 5 then
      ReleaseKey("F")
   end
end