Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FreshWin (c) Fresh Technologies - <b>msstatus() mouse function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  MSSTATUS()                                                  Mouse Function
 Purpose..: Get the mouse status
-------------------------------------------------------------------------------
 Syntax...: MsStatus( [<nButton>, [<nRow>, [<nCol>]]] ) --> NIL

 Arguments: [<nButton>] = Memory address to receive value of button press.
                          Valid button numbers are defined in FW_MAIN.CH
                          as follows:

              Mouse Button Translate Directives as found in FW_MAIN.CH
              --------------------------------------------------------
              Value  FW_MAIN.CH   Button(s) pressed
              --------------------------------------------------------
              0      MB_NONE      none
              1      MB_LEFT      left
              2      MB_RIGHT     right
              3      MB_LT_RT     middle
              4      MB_MIDDLE    left and right
              5      MB_LT_MD     left and middle
              6      MB_MD_RT     middle and right
              7      MB_ALL       all buttons pressed
              --------------------------------------------------------

              [<nRow>]  = Memory address to receive the row
                          where the mouse is positioned. This variable
                          should be passed by reference.

              [<nCol>]  = Memory address to receive the column
                          where the mouse is positioned. This variable
                          should be passed by reference.

 Returns..: NIL

 Source...: MSSTATUS.C
-------------------------------------------------------------------------------
 Example..: . The function should be used to collect information on
              a mouse press. It will tell you if the button was
              pressed and at what screen position the mouse was found
              when it was pressed. The example demonstrates waiting
              until a key or button is pressed.

            nKey     := 0
            mMsPress := 0

            while nKey == 0 .and. nMsPress == MB_NONE
               nKey := inkey()
               MsStatus( @nMsPress, @nRow, @nCol )

            enddo

            if nMsPress == MB_LEFT .and. nRow == 23
               ? "You clicked on row 23 with the LEFT button..."

            endif

See Also: MsInKey() MsIsPress()

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