[英]Logitech Script, 1st and 2nd click events with time reset
What I want to do is if I press the button on my mouse it uses a key like "E" and if I press the button again it uses the key "W" and after 2 seconds it resets, I mean if I don't press the same button after 2 seconds it uses letter "e " again.我想要做的是,如果我按下鼠标上的按钮,它会使用像“E”这样的键,如果我再次按下按钮,它会使用“W”键,2 秒后它会重置,我的意思是如果我不这样做2 秒后按下相同的按钮,它再次使用字母“e”。 Is that possible?
那可能吗?
I've tried some codes but no results yet:我已经尝试了一些代码,但还没有结果:
function OnEvent(event, arg, family)
if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
toggle = not toggle
if toggle then
PressKey("e")
ReleaseKey("e")
else
PressKey("w")
ReleaseKey("w")
end
end
end
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
hi i'm looking for something similar, but without time reset.嗨,我正在寻找类似的东西,但没有时间重置。 like, 1st click "e", 2nd click "w", 3rd click "e", 4th click "w", and again and again
比如,第一次点击“e”,第二次点击“w”,第三次点击“e”,第四次点击“w”,一次又一次
someone can help me?有人可以帮助我吗? thank u guys
谢谢你们
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.