[英]Logitech Script: 1st click, 2nd click, 1st click, 2nd click event
我想要做的是,如果我按下鼠標上的按鈕,它會使用像“E”這樣的鍵,如果我再次按下按鈕,它會使用鍵“W”,再按一次按鈕“e”,再按一次“w” ”。
那可能嗎?
我找到了這個,但這並不是我想要的:
https://stackoverflow.com/a/62067519/17803151
local prev_tm_btn5 = -math.huge
function OnEvent(event, arg, family)
if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
local tm = GetRunningTime()
local key = tm - prev_tm_btn5 > 2000 and "e" or "w"
prev_tm_btn5 = tm
PressKey(key)
Sleep(15)
ReleaseKey(key)
end
end
謝謝你 !
嘗試:
local key
function OnEvent(event, arg, family)
if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
key = key == "w" and "e" or "w"
PressKey(key)
Sleep(15)
ReleaseKey(key)
end
end
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.