FlushMouse
FlushMouse
 
Parameters: NONE
Returns: NONE
 

      The FlushMouse command, clears the mouse input que. This can be used to ensure the user doesn't hold the mouse button down for example.


FACTS:


      * None



Mini Tutorial:


      This examble reads the current button state, if a button is pressed a message is displayed and the FlushMouse is executed. So it will not allow the mouse to be held down.


  
; Set the Demo to run at 20 frames per second or less
  SetFPS 20
  
; Start an infinite D0-LOOp
  Do
     
   ; Clear the screen to black RGB(0,0,0)
     Cls RGB(0,0,0)
     
   ; Read current Button status of the mouse.
     ButtonState = MouseButton()
     
   ; Display this button state to the screen.
     Print "Mouse Button State:"+Str$(ButtonState)
     
     
   ; If any button was pressed, then flush all mouse input events
     If ButtonState<>0
        Print "A Mouse Button was Pressed"
        
      ; Clear the mouse input que
        FlushMouse
     EndIf
     
     
   ; Display the screen
     Sync
     
   ; Loop back to the DO statement
  Loop
  




 
Related Info: LeftMouseButton | MidMouseButton | MouseButton | RightMouseButton :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com