Hiding and Restoring the Physical Cursor

There are two ways to make the physical cursor disappear from the screen. One way is to move the cursor off the screen and the other is to make the cursor invisible at a location on the screen.

Moving the Physical Cursor Off Screen

You can hide the cursor so that it doesn't show on the screen by moving it just below the last row of the screen. Do this by calling:

csr_mv(vs_rowq(), 0);

The function vs_rowq() returns the number of rows on the current video display. Row vs_rowq() is the row just beneath the last row on the video display (since numbering starts at 0). By moving the physical cursor to a row that is not able to be displayed, you effectively hide the cursor.

Making the Physical Cursor Invisible

You can also hide the cursor at its current location by calling the hide cursor function, csr_hide():

void csr_hide()

Function csr_hide() stores the location of the cursor internally, in static variables. If the cursor is already hidden, csr_hide() will not store the cursor location.

To restore the cursor to the screen at the location saved by csr_hide(), use the show cursor function:

void csr_show()

csr_show() will not attempt to show the cursor unless the cursor has been previously hidden with a call to csr_hide().

Determining If the Cursor Is Visible

You can determine if the physical cursor is visible by calling the is physical cursor visible function:

int csr_isvisible()

The function returns a non-zero value if the physical cursor is visible and 0 if the physical cursor is hidden.


Home Contents Previous Next