【问题标题】:Binding Shift to my mouse 1 and quick switch LUA script将 Shift 绑定到我的鼠标 1 并快速切换 LUA 脚本
【发布时间】:2020-05-19 08:32:35
【问题描述】:

我正在尝试创建一个 LUA 脚本,将我的 shift 绑定到 mouse1,类似于 csgo 中的 strafe stop。我成功地制作了脚本,但唯一的问题是当我按住鼠标 1 时,我的角色移动相当于按下我想要避免的 shift。是否可以将我的 shift 绑定到 mouse1 以便仅在喷涂时不点击(按住 mouse1)并且对于快速切换我似乎找不到解决方案,当我单击鼠标 2 时,它只是按 q 而不射击(按鼠标 1) https://imgur.com/a/tEh0WO5 有什么解决办法吗?谢谢你。 ** 这是我一直在研究的快速切换脚本,我希望我的脚本能够在瞄准时和点击鼠标按钮 1 后快速切换到上一个武器。

EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)



if (event == "MOUSE_BUTTON_PRESSED" and arg == 2 ) then PressMouseButton(1) 


                   PressKey("q")
Sleep(5)
ReleaseKey("q")
end
end 

这是带有 shift 的 strafestop 。从昨天丢失了我的脚本,这没有任何作用。我希望能够在点击鼠标 1 的同时点击并按下按键转移,但在喷涂时(按住鼠标 1)甚至不知道它是否可能

EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)


if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then 
Sleep(1)
      PressKey("lshift") 
      Sleep(5)
      ReleaseKey("lshift") 
end
end

【问题讨论】:

  • 编辑了我的问题

标签: lua logitech-gaming-software


【解决方案1】:
EnablePrimaryMouseButtonEvents(true)

local LMB_pressed_at

function OnEvent(event, arg)
   if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then
      LMB_pressed_at = GetRunningTime()
   end
   if event == "MOUSE_BUTTON_RELEASED" and arg == 1 and GetRunningTime() - LMB_pressed_at < 200 then
      PressKey("lshift")
      Sleep(15)
      ReleaseKey("lshift")
   end
end

【讨论】:

  • 非常感谢。
  • 嘿,你能再帮我写 1 个脚本吗?
猜你喜欢
  • 2023-01-03
  • 2021-05-28
  • 2020-12-21
  • 2012-08-14
  • 1970-01-01
  • 2020-01-26
  • 2021-10-07
  • 2018-04-19
  • 2011-01-12
相关资源
最近更新 更多