Re: [AHK-] 仅在限定视窗内 用左键长按取代中键

楼主: panex0845 (胖克思)   2020-11-26 02:49:26
※ 引述《bhbbbbb (斯马克)》之铭言:
: 我自己觉得你的想法是可以做到的,但实务上应该还是不太方便,例如反白之类的动作可能
: 也会出问题。
: 总之我用“先按著右键不放,再按下左键”的这个方法来取代中键
: 这样的话就算是在其他的视窗应该也不太会出事(但下面的范例我还是让他只在chrome中作用
我的想法是 能按一个键就不要按两个 不然长期下来 手很酸
鼠标光标长按500毫秒不动送出中键 不影响反白动作
试用了一下还满顺手的 以下code
#if mouseover("chrome_renderwidgethosthwnd")
~Lbutton::
while (GetKeyState("lbutton" , "P")) {
MouseGetPos, x1, y1
sleep 520
MouseGetPos, x2, y2
if (A_TimeSinceThisHotkey>500 and InStr(x1 . y1, x2 . y2)
and (GetKeyState("lbutton" , "P"))) {
send {lbutton up}
send {mbutton}
keywait, lbutton
break
}
}
return
#if
mouseover(class) {
MouseGetPos,,,, OutputVarControl
return InStr(OutputVarControl, class)
}

Links booklink

Contact Us: admin [ a t ] ucptt.com