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 - mousechkbutton() test if mouse buttons are pressed http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 mousechkbutton()    Test if mouse buttons are pressed
------------------------------------------------------------------------------
 Declaration
   mouse.hdr

 Syntax
   func logical mousechkbutton extern
   param value uint uButton

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

 Return
   A logical indicating button state.

 Description
   This function returns .t. if the specfied button(s) was/were pressed
   during execution of the function.

 Example
   #define EXAMPLE_MOUSE
   #include example.hdr

   proc Test_mousechkbutton
   if mouseavail()
      clear
      cursor( .f. )
      @ 0, 0 ?? "Press various mouse buttons, finish with Esc"
      mouseon()
      do while inkey() != K_ESC
         @ 2, 0 ?? iifc( mousechkbutton( MB_LEFT ),   "Left",   space( 4 ) )
         @ 3, 0 ?? iifc( mousechkbutton( MB_MIDDLE ), "Middle", space( 6 ) )
         @ 4, 0 ?? iifc( mousechkbutton( MB_RIGHT  ), "Right",  space( 5 ) )
      enddo
      mouseoff()
   else
      ? "Mouse is not available"
   endif
   endproc

   proc main
   Test_mousechkbutton()
   endproc

See Also: mouseanybutton() mousebuttval() mouseclick()

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