ZanaxNL 0 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 Share this post Link to post Share on other sites monoscout999 10 monoscout999 10 a member Active Members 10 1,048 posts 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 Share this post Link to post Share on other sites
Tvern 11 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) Share this post Link to post Share on other sites
ZanaxNL 0 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 Share this post Link to post Share on other sites
monoscout999 10 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 Share this post Link to post Share on other sites
ZanaxNL 0 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 Share this post Link to post Share on other sites
monoscout999 10 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 Share this post Link to post Share on other sites