MouseMoveZ
Distance = MouseMoveZ()
 
Parameters: NONE
Returns:

    Distance = The distance the Mouse Wheel changed
 

      The MouseMoveZ() function will return the change in Z position (Scroll wheel) of the mouse pointer from the last call of the function.



FACTS:


      * You shouldn't call this function more than once per update.

      The reason for this, is that each time you call a MouseMove function, it calculates the distance moved, between where the mouse currently is and where it was the last time you asked.

      So requesting the move distance various times without allowing ample time between calls, will mean that your trying to read mouse, faster than what the user can move it.




Mini Tutorial:


      This example simply should how to display the change in the mouse position.

  
  
; Tell PB to limit this programs speed to 10 frames per second
  SetFPS 10
  
; Start an infinite D0-LOOp
  Do
     
   ; Clear the screen to black RGB(0,0,0)
     Cls RGB(0,0,0)
     
   ; Read How far (in pixels) the mouse has moved
   ; since the last update.
     MovedDistanceX=MouseMoveX()
     MovedDistanceY=MouseMoveY()
     
   ; Read How Far the Mouse Wheel Has moved
   ; since the last update
     MovedDistanceZ=MouseMoveZ()
     
     
   ; Display the change in the Mouse X & Y position
     Print MovedDistanceX
     Print MovedDistanceY
     Print MovedDistanceZ
     
     
   ; Display the screen
     Sync
     
   ; Loop back to the DO statement
  Loop
  
  




 
Related Info: Mouse | MouseButton | MouseMoveX | MouseMoveY | MouseX | MouseY | MouseZ | SetMouse | SetMouseX | SetMouseY :
 


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