将鼠标按键1上的命令应用到7和8号键,我使用罗技鼠标

我有一个在鼠标按键1上运行的脚本,我希望相同的脚本也可以在鼠标按键7和8上运行。这是可能的吗?

EnablePrimaryMouseButtonEvents(true);

function OnEvent(event, arg)
    if IsKeyLockOn("numlock") then
        if IsMouseButtonPressed(1) then
            Sleep(200)
            repeat
                MoveMouseRelative(0,6)
                Sleep(30)
            until not IsMouseButtonPressed(1)
        end
    end
end
点赞
用户1847592
用户1847592

步骤1.

进入LGS中的大老鼠图片。

将“左击”命令(或在GHUB中为“主要点击”)分配给物理按钮7和8。


步骤2.

设置脚本

EnablePrimaryMouseButtonEvents(true)

function OnEvent(event, arg)
   if event == "MOUSE_BUTTON_PRESSED" and arg == 1 and IsKeyLockOn("numlock") then
      Sleep(200)
      repeat
         MoveMouseRelative(0,6)
         Sleep(30)
      until not IsMouseButtonPressed(1)
   elseif event == "MOUSE_BUTTON_PRESSED" and arg == 7 and IsKeyLockOn("numlock") then
      Sleep(200)
      repeat
         MoveMouseRelative(0,6)
         Sleep(30)
      until not IsMouseButtonPressed(1)
   elseif event == "MOUSE_BUTTON_PRESSED" and arg == 8 and IsKeyLockOn("numlock") then
      Sleep(200)
      repeat
         MoveMouseRelative(0,6)
         Sleep(30)
      until not IsMouseButtonPressed(1)
   end
end
2021-09-19 14:20:24