TaxiDriver Posted February 13, 2007 Share Posted February 13, 2007 (edited) hi..i'm trying to write a script that let me easily paste texts from clipboard using the middle mouse button..here's what I've got so far.. #include <Misc.au3> While 1 if _IsPressed("04") Then MiddleClickPaste() Sleep(250) WEnd Func MiddleClickPaste() ClipGet() If @error <> 1 then send ("{CTRLDOWN}v") send("{CTRLUP}") EndIf EndFunc the script runs fine..except that when you press and *hold* the middle button, it keeps pasting texts until you release the button..I want to know if there's way to check if middle button is released.. Edited February 13, 2007 by TaxiDriver Link to comment Share on other sites More sharing options...
AU3Newbie Posted February 13, 2007 Share Posted February 13, 2007 #include <Misc.au3> Dim $Mid=0 While 1 if _IsPressed("04")&$Mid=0 Then MiddleClickPaste() Sleep(250) WEnd Func MiddleClickPaste() ClipGet() If @error <> 1 then send ("{CTRLDOWN}v") send("{CTRLUP}") $mid=1 EndIf EndFunc HAVEN't TESTed it! Link to comment Share on other sites More sharing options...
herewasplato Posted February 13, 2007 Share Posted February 13, 2007 tested#include <Misc.au3> While 1 If _IsPressed("04") Then MiddleClickPaste() Sleep(250) WEnd Func MiddleClickPaste() ClipGet() If @error <> 1 Then Send("{CTRLDOWN}v") Send("{CTRLUP}") EndIf Do Sleep(10) Until Not _IsPressed("04") EndFunc ;==>MiddleClickPaste [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now