按下另一个按钮时如何自动释放鼠标按钮

发布于 2025-02-13 20:08:43 字数 344 浏览 1 评论 0原文

是否可以对LUA脚本进行编程,每次我按RMB + LMB(按此顺序),按下LMB时会发行RMB?这个想法是:单击LMB将“取消” rmb,,但是当LMB发布时,将重新启动RMB(因为我一直按下它)。我玩的游戏需要粉碎(不是同时同时)RMB(AIM),然后是LMB(spell)多次(和快速)以更快地发送多个咒语,,但是每次我投掷时咒语(LMB),我需要再次瞄准(RMB)发送另一个。这个概念是,我只想将RMB(AIM)按下并粉碎LMB(咒语),并且使用此脚本,游戏将理解我在每个咒语之后实际上都会再次瞄准,而我只是按下AIM按钮。

如果可能的话,在RCTRL键上打开/关闭此会很酷。 谢谢你!

Is it possible to program a lua script that every time I press RMB + LMB (in that order), RMB releases when LMB is pressed? The idea is: Clicking LMB will 'cancel' RMB, but RMB will be retaken (since I keep pressing it) when LMB was released. I play a game that I need to smash (not both at the same time) RMB (aim) and then LMB (spell) multiple times (and fast) to send multiple spells in a faster way, but every time I throw the spell (LMB), I need to aim again (RMB) to send another. The concept is that I want to just keep RMB (aim) pressed and smash LMB (spell) only, and with this script the game will understand I'm actually aiming again after every spell, while I'm just pressing the aim button.

If possible, it would be cool to turn this on/off on RCTRL key.
Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦里泪两行 2025-02-20 20:08:44

步骤#1

设置脚本

local spell_while_aim, active, rmb_is_down

local function RMB()
   rmb_is_down = not rmb_is_down
   if rmb_is_down then
      PressMouseButton(3)
   else
      ReleaseMouseButton(3)
   end
end

function OnEvent(event, arg)
   if event == "PROFILE_ACTIVATED" then
      EnablePrimaryMouseButtonEvents(true)
   elseif event == "MOUSE_BUTTON_PRESSED" and arg == 1 then  -- left
      if active and rmb_is_down then
         RMB()
         spell_while_aim = true
      end
   elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then -- left
      if spell_while_aim then
         spell_while_aim = false
         Sleep(20)
         RMB()
      end
   elseif event == "MOUSE_BUTTON_PRESSED" and arg == 2 then  -- right
      RMB()
   elseif event == "MOUSE_BUTTON_RELEASED" and arg == 2 then -- right
      if spell_while_aim then
         spell_while_aim = false
      else
         RMB()
      end
   elseif event == "MOUSE_BUTTON_PRESSED" and arg == 3 then  -- middle
      active = not active
   elseif event == "PROFILE_DEACTIVATED" then
      ReleaseMouseButton(3)
   end
end

步骤#2

非安装标准命令“右键单击”鼠标大图上的物理鼠标按钮#2

  • for Ghub:单击并从 LGS的下拉菜单
  • :单击并从下拉菜单中选择“ Unsign”

Step #1

Set the script

local spell_while_aim, active, rmb_is_down

local function RMB()
   rmb_is_down = not rmb_is_down
   if rmb_is_down then
      PressMouseButton(3)
   else
      ReleaseMouseButton(3)
   end
end

function OnEvent(event, arg)
   if event == "PROFILE_ACTIVATED" then
      EnablePrimaryMouseButtonEvents(true)
   elseif event == "MOUSE_BUTTON_PRESSED" and arg == 1 then  -- left
      if active and rmb_is_down then
         RMB()
         spell_while_aim = true
      end
   elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then -- left
      if spell_while_aim then
         spell_while_aim = false
         Sleep(20)
         RMB()
      end
   elseif event == "MOUSE_BUTTON_PRESSED" and arg == 2 then  -- right
      RMB()
   elseif event == "MOUSE_BUTTON_RELEASED" and arg == 2 then -- right
      if spell_while_aim then
         spell_while_aim = false
      else
         RMB()
      end
   elseif event == "MOUSE_BUTTON_PRESSED" and arg == 3 then  -- middle
      active = not active
   elseif event == "PROFILE_DEACTIVATED" then
      ReleaseMouseButton(3)
   end
end

Step #2

Unassign standard command "Right Click" from physical mouse button #2 on the big picture of mouse

  • For GHUB: click and select DISABLE from the drop-down menu
  • For LGS: click and select "Unassign" from the drop-down menu
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文