2013-03-28 53 views
1

基本上我有一個問題,點擊鼠標中鍵時會出現多個非常快的中間鼠標。例如,如果我用中鼠標在新標籤中打開鏈接,它將打開該標籤的大約10個。我已經嘗試了所有常規方法來修復它,即。驅動程序修復等。我現在想嘗試的是用Windows的AHK(自動熱鍵)進行鼠標清除。修復多箇中間鼠標點擊

基本上我在想什麼是做到這一點:

while (forever) 
    if(capture the middle mouse) 
     sleep 500 ms 
     mouse click 
    end 
end 

誰能給這種做法一些建議嗎?

或者我想過做一個鼠標熱鍵:

$MButton:: 
Loop 
{ 
sleep 500 
if not GetKeyState("MButton", "P") 
    break ; Break out of the loop. 
} 
send {MButton} 
return 

任何人都可以看到這個什麼問題嗎?

+0

是的,我測試了它,第二個工作,任何與第一個? – 2013-03-28 05:45:26

+0

@Frank我認爲這個問題是合適的,因爲在這個論壇上詢問一個破損的鼠標是不合適的。 – 2013-03-28 06:04:20

回答

2

您可以有一個更簡單的解決方案,沒有延遲。 如果最後一次點擊是50毫秒前,這將忽略中間點擊。

#Persistent 

global pressed_g := 0 
global delay_g := 50 ; delay in miliseconds, increase this value if your multiple click take longer than delay_g time 

return 

MButton:: 
    if(pressed_g = 0) 
    { 
     Send, {MButton} 
     tooltip,sent 
     pressed_g := 1 
    } 
    SetTimer, Countdown , Off 
    SetTimer, Countdown , -%delay_g% 

return 


Countdown: 
    pressed_g := 0 
return 
1

難道你是在找這個嗎?您按MButton並且按住該按鈕時,腳本將繼續觸發MButton

#Persistent 
MButton:: 
while GetKeyState("MButton", "P") ; While the Middle Mouse button key is being held down 
{ 
    Send, {MButton} 
} 
return