| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Determines the screen row position of the mouse cursor.
MRow() --> nMouseRow
The function returns the row position of the mouse cursor as a numeric value.
MRow() is used in full screen or console window applications to determine the current screen row position of the mouse cursor. The top screen row has number zero, while the bottom screen row has number MaxRow().
Note to obtain proper mouse input from the user, function Inkey() should be called including mouse events.
| See also: | Inkey(), MCol(), MDblClk(), MHide(), MLeftDown(), MRightDown(), MSetCursor(), MShow(), SET EVENTMASK |
| Category: | Mouse functions |
| Source: | rtl\mouseapi.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example changes the event mask for Inkey() to ALL events
// and displays the mouse cursor position when the left button is pressed.
#include "Inkey.ch"
PROCEDURE Main
LOCAL nEvent, nRow, nCol, cPos
CLS
MShow()
? "Click with left mouse button (press ESC to quit)"
SET EVENTMASK TO INKEY_ALL
DO WHILE Lastkey() <> K_ESC
nEvent := Inkey(0)
IF nEvent == K_LBUTTONDOWN
nRow := MRow()
nCol := MCol()
cPos := LTrim( Str(nRow) ) + "," + LTrim( Str(nCol) )
// display current mouse cursor position
@ nRow, nCol SAY cPos
ENDIF
ENDDO
RETURN
http://www.xHarbour.com