Sign in to follow this  
Followers 0
ZanaxNL

While [RightMouseButton] = 1 ~How~

7 posts in this topic

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

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
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                        





(adsbygoogle = window.adsbygoogle || []).push({});




                    
                
                    
                    
                    






    
    
        
monoscout999   

    
        
    
             9
    
        
    

        
            
                a member
            
            

            
                

    
        
    

            
            Active Members
            
            
                

    
        
    
             9
    
        
    

                1,048 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #2 · 
            Posted 
            
            
            
        
    

    


            
        
            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

#4 ·  Posted (edited)

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

*EDIT didn't saw second post.

i will look at it.

Edited by ZanaxNL

Share this post


Link to post
Share on other sites

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 :huh2:

Share this post


Link to post
Share on other sites

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

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

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0