Logitech宏!当我按住鼠标右键时,命令不会停止。

huangapple go评论111阅读模式
英文:

- Logitech macros ! the command doesn't stop while I'm holding down the right mouse button

问题

  • 这里是我的所有LUA文件。
  • 这里是我的Lua文件!它们用于LOGitech Ghud。当宏激活时,按住鼠标右键,然后按下鼠标左键以启动宏(在按住鼠标右键时无法停止宏!)- 我希望它们在我松开鼠标左键时停止。
	RC_COUNT = #RC_TABLE
	local LastIndex = 1
	if IsMouseButtonPressed(1) then 
		if (LastIndex <= RC_COUNT) then
			i = LastIndex
		else
			i = 1
		end
		while i <= RC_COUNT do
			if IsMouseButtonPressed(3) then
				PressAndReleaseMouseButton(1)
				MoveMouseRelative(RC_TABLE[i].x, RC_TABLE[i].y)
				Sleep(18)
			else
				LastIndex = i
				break
			end
			i = i + 1
		end
	end
end

当我右键单击时,我的命令将使用!并且当我左键单击时,它们将继续工作。

英文:

https://docs.google.com/document/d/1pX81q-AEn2o7n0rlpvD-GOoKCakMxqO0v8-JXPjtEnA/edit?usp=sharing

----- - here are all my LUA files

  • here are all my Lua files! they are used in LOGitech Ghud . when the macro is active, hold down the right mouse button and press the left mouse button to start the macro ( you cannot stop the macro while you are holding the right mouse button!) - I want them to stop when I release the left mouse button
	RC_COUNT = #RC_TABLE
	local LastIndex = 1
	if IsMouseButtonPressed(1)then 
		if (LastIndex &lt;= RC_COUNT) then
			i = LastIndex
		else
			i = 1
		end
		while i &lt;= RC_COUNT do
			if IsMouseButtonPressed(3)then
				PressAndReleaseMouseButton(1)
				MoveMouseRelative(RC_TABLE[i].x, RC_TABLE[i].y)Sleep(18)

			else
				LastIndex = i
				break
			end
			i = i + 1
		end
	end
end

when i right click my command will use ! and I left click they will continue working

答案1

得分: 0

  1. 在游戏中,在“控制设置”中,引入“射击”动作的替代键。例如,将其设置为键盘上的<kbd>P</kbd>键。因此,现在在游戏中,您可以使用鼠标左键或键盘上的<kbd>P</kbd>键进行射击。当然,通常情况下,您将使用鼠标左键进行手动射击,但您的GHub脚本将使用<kbd>P</kbd>键。

  2. 用以下内容替换这两行代码:

        if IsMouseButtonPressed(3) and IsMouseButtonPressed(1) then
            PressAndReleaseKey("P")
英文:
  1. In the game, in the "Controls Settings", introduce alternative key for "Shoot" action. For example, let it be keyboard key <kbd>P</kbd>. So, now in the game you can shoot either using Left Mouse Button or using Keyboard key <kbd>P</kbd>. Of course, you will use LMB for manual shooting as usually, but your GHub script will use <kbd>P</kbd>.

  2. Replace these two lines

        if IsMouseButtonPressed(3)then
            PressAndReleaseMouseButton(1)

with the following:

        if IsMouseButtonPressed(3) and IsMouseButtonPressed(1) then
            PressAndReleaseKey(&quot;P&quot;)

huangapple
  • 本文由 发表于 2023年7月5日 00:29:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/76614469.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定