SetMouseY
SetMouseY Ypos
 
Parameters:

    Ypos = The Y coordinate of where you wish to locate the mouse pointer
Returns: NONE
 

      SetMouseY will position the windows mouse pointer along the Y axis



FACTS:



      * When a program is running in windowed screen mode, the mouse now expect coordinates relevant to the windows desk top. So in order to reposition the mouse over your window correctly, you'll need to offset by the screens current position. See GetScreenYpos().





Mini Tutorial:


      This example shows uses the SetMouse and SetMouseX and SetMouseY commands to randomly reposition the mouse pointer when certain keys are hit.


  
  Do
   ; Clear the screen to Black RGB(0,0,0)
     Cls RGB(0,0,0)
     
   ; Display a Message
     Print "Hit the Space Key To Randomly Set the Mouse POsition"
     
   ; When the Space bar is hit, the mouse will be
   ; randomly repositioned over the PlayBASIC window
     
     If SpaceKey()
        x=GetScreenXpos()
        y=GetScreenXpos()
        w=GetScreenWidth()
        h=GetScreenHeight()
        SetMouse x+Rnd(w),y+Rnd(h)
     EndIf
     
   ; When the X or Y keys are hit, the mouse will
   ; be randomly repositioned over the Play Basic
   ; window, on either the X or Y axis
     
     k$=Inkey$()
     Print "Hit the X key To Randomly Set the Mouses X Position"
     If k$="x"
        SetMouseX GetScreenXpos()+Rnd(GetScreenWidth())
     EndIf
     
     Print "Hit the Y key To Randomly Set the Mouses Y Position"
     If k$="y"
        SetMouseY GetScreenYpos()+Rnd(GetScreenHeight())
     EndIf
     
   ; Show The SCreen and Loop back to the Do statement
     Sync
  Loop
  




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


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