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 - mouseclick() check for a mouse click http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 mouseclick()        Check for a mouse click
------------------------------------------------------------------------------
 Declaration
   mouse.hdr

 Syntax
   func logical mouseclick extern
   param value uint uButton

 Arguments
   uButton is a mouse button number. See mouse.hdr for mouse button
   identifier constants.

 Return
   A logical indicating mouse button state.

 Description
   This function waits until the specified button is released (if it was
   pressed at function call). It returns .t. after the button is
   released. If the button was not pressed at function call, the function
   returns .f. immediately.

 Example
   #define EXAMPLE_MOUSE
   #include example.hdr

   proc Test_mouseclick
   if mouseavail()
      clear
      cursor( .f. )
      @ 0, 0 ?? "Press various mouse buttons, finish with Esc"
      mouseon()
      do while inkey() != K_ESC
         if mouseanybutton()
            do case
            case mouseclick( MB_LEFT )
               @ 2, 0 ?? "Left  "
            case mouseclick( MB_MIDDLE )
               @ 2, 0 ?? "Middle"
            case mouseclick( MB_RIGHT )
               @ 2, 0 ?? "Right "
            endcase
         endif
      enddo
      mouseoff()
   else
      ? "Mouse is not available"
   endif
   endproc

   proc main
   Test_mouseclick()
   endproc

See Also: mouseanybutton() mousebuttval() mousechkbutton()

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