Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - mousedefarea() restrict mouse movement to specified area http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 mousedefarea()      Restrict mouse movement to specified area
------------------------------------------------------------------------------
 Declaration
   mouse.hdr

 Syntax
   proc mousedefarea extern
   param value uint uTop, ;
         value uint uLeft, ;
         value uint uBottom, ;
         value uint uRight

 Arguments
   uTop is the top row of the mouse area.
   uLeft is the leftmost column of the mouse area.
   uBottom is the bottom row of the mouse area.
   uRight is the rightmost column of the mouse area.

 Return
   None.

 Description
   This procedure defines a "mouse window" within which mouse activity is
   restricted. After this definition is in effect, the mouse cursor can
   only be moved inside the specified borders. To change the area, the
   procedure must again be called with the new coordinates. If using
   screen sizes other than the default (80 * 25), this procedure can
   also be used to enlarge the mouse area.

 Example
   #define EXAMPLE_MOUSE
   #include example.hdr

   proc Test_mousedefarea
   vardef
      uint uButt
   enddef
   if mouseavail()
      clear
      cursor( .f. )
      @ 0, 0 ?? "Mouse can move in whole screen area"
      // detect the screen size and set __max_row and __max_col
      detectmaxrowcol()
      // set the mouse area according to the current screen size
      mousedefarea( 0, 0, __max_row, __max_col )
      mouseon()
      mousebuttwpress( MB_LEFT )
      delay( 2 )
      @ 5, 10 to 10, 20
      mousedefarea( 6, 11, 9, 19 )
      @ 7, 13 ?? "Mouse"
      @ 8, 13 ?? "trap"
      mousebuttwpress( MB_LEFT )
      mouseoff()
   else
      ? "Mouse is not available"
   endif
   endproc

   proc main
   Test_mousedefarea()
   endproc

See Also: mouseinarea()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson