Jump to content

While [RightMouseButton] = 1 ~How~


Recommended Posts

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


            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


monoscout999
            
            
                Posted 
                
            
        
    
    
        


monoscout999
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 1k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
a member
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            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
Link to comment
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

*EDIT didn't saw second post.

i will look at it.

Edited by ZanaxNL
Link to comment
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:
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...