ZanaxNL Posted June 21, 2011 Share Posted June 21, 2011 Hey, I want to make a script that works with the RightMouseButton So while right mouse button is kept pressing (pressed down, sorry my english is not that great) Then he must do something. While RightMouseButton = 1 expandcollapse popup WEnd Thx. I had looked to _IsPressed but i dont know if that works when rightmousebutton is pressed down. that is importent so.. : ( Zanax Link to comment Share on other sites More sharing options... monoscout999 Posted June 21, 2011 monoscout999 Active Members 1k a member Share Posted June 21, 2011 Use GUIGetCursorInfo() i already have an example of this... $gui = GUICreate("MouseClicks Until you hold the mousebutton?", 400, 250) $radio1 = GUICtrlCreateRadio("Left", 100, 30, 50, 20) Guictrlsetstate($radio1,1) $radio2 = GUICtrlCreateRadio("Right", 250, 30, 50, 20) $label1 = Guictrlcreatelabel("Click inside the GUI",100,100,100,30) Local $a = 2, $i = 0 GUISetState() While 1 $gui = GUIGetMsg() Switch $gui Case -3 Exit ;$GUI_EVENT_CLOSE Case $radio1 $a = 2 Case $radio2 $a = 3 EndSwitch $aMouse = GUIGetCursorInfo() If Not @error Then If $aMouse[$a] = 1 Then $i += 1 Tooltip($i) EndIf EndIf WEnd Link to comment Share on other sites More sharing options...
Tvern Posted June 21, 2011 Share Posted June 21, 2011 Alternative that works outside your GUI #include<misc.au3> Global $u32dll = DllOpen("user32.dll") Do While _IsPressed("02",$u32dll) ConsoleWrite("RMB is down" & @CRLF) Sleep(500) WEnd Sleep(10) Until _IsPressed("1B",$u32dll) ;Esc exists script DllClose($u32dll) Link to comment Share on other sites More sharing options...
ZanaxNL Posted June 21, 2011 Author Share Posted June 21, 2011 (edited) hmmmokay. so something likeGUIGetCursorInfo([WINDOW])but i don't really see how i can fix it to i want.If RightMouseButton is pressed then DoStuff().$a = 3 > secondairy down > rightmousebutton. but i realy don't know how to get further from here. ; S: *(Zanax*EDIT didn't saw second post.i will look at it. Edited June 21, 2011 by ZanaxNL Link to comment Share on other sites More sharing options...
monoscout999 Posted June 21, 2011 Share Posted June 21, 2011 hmmm okay. so something like GUIGetCursorInfo([WINDOW]) but i don't really see how i can fix it to i want. If RightMouseButton is pressed then DoStuff(). $a = 3 > secondairy down > rightmousebutton. but i realy don't know how to get further from here. ; S : *( Zanax Look the Tvern example is much easier and more funcional Link to comment Share on other sites More sharing options...
ZanaxNL Posted June 21, 2011 Author Share Posted June 21, 2011 Thx both. I guess this will work. I though this function dont work if button is still pressed ,but it does i gues/hope : P So now the script will do: If rightmousebutton is down(clicking) then he dostuff... if rightmousebutton is NOT down then stay idle.. wait till key is pressed again Right? tyty, Zanax Link to comment Share on other sites More sharing options...
monoscout999 Posted June 21, 2011 Share Posted June 21, 2011 mmmmmmmm something like this...WHILE rightmousebutton is down(clicking) then he dostuff...WHILE NOT rightmousebutton is NOT down then stay idle.. wait till key is pressed again 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