Script Logitech

如何在大写锁定键中包括配置文件激活(9),如何包含快速火力? 我也有一个罗技g pro键盘,我只会将大写锁定键放在减少枪支上的后座力

local recoil_mode  -- 可能的值: false、8、7、6
 local recoil_loops = {
       [8] = {
          {x=-1, y=2, delay=7},
          {x=1, y=2, delay=7},
          {x=-1, y=3, delay=8},
          {x=1, y=3, delay=5},
       },
       [7] = {
          {x=0, y=5, delay=5},
          {x=0, y=6, delay=7},
          {x=0, y=7, delay=6},
          {x=0, y=8, delay=4},
          {x=0, y=9, delay=6},
          {x=0, y=11, delay=5},
       },
       [6] = {
          {x=0, y=8, delay=50},
          {x=0, y=8, delay=50},
          {x=0, y=8, delay=50},
          {x=0, y=8, delay=50},
          {x=0, y=9, delay=50},
          {x=0, y=11, delay=50},
       },
    }

    function OnEvent(event, arg)
       if event == "PROFILE_ACTIVATED" then
          OutputLogMessage("配置文件已激活")
          EnablePrimaryMouseButtonEvents(true)
       elseif event == "PROFILE_DEACTIVATED" then
          OutputLogMessage("配置文件已停用")
          ReleaseMouseButton(1) -- 防止它卡在上面
       elseif event == "MOUSE_BUTTON_PRESSED" and recoil_loops[arg] then
          recoil_mode = recoil_mode ~= arg and arg
          OutputLogMessage("后座模式现在为 "..tostring(recoil_mode))
       elseif event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil_mode then
          local loop = recoil_loops[recoil_mode]
          local j = 0
          repeat
             j = j % #loop + 1
             if IsMouseButtonPressed(3) then  -- 仅在按下RMB时
                MoveMouseRelative(loop[j].x, loop[j].y)
             end
             Sleep(loop[j].delay)
          until not IsMouseButtonPressed(1)
       end
     end
点赞