Implementation of the setcursorposition() and getcursorposition() functions for manipulating the cursor position on Windows terminals. More...
#include <stdlib.h>
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include "cursor.h"
#include "split.h"
Go to the source code of this file.
Functions | |
static void | _disableInputEcho (void) |
Disable echoing of input and disable line input mode (where the Enter key must be entered to complete input). | |
static void | _enableInputEcho (void) |
Enable echoing of input. | |
void | disableinputecho (void) |
Disable echoing input until enableinputecho() is called. | |
void | enableinputecho (void) |
Enable echoing input, which should be the default mode. Call this only after calling disableinputecho();. | |
void | setcursorposition (int row, int column) |
Move the text cursor to the specified screen coordinates. | |
void | getcursorposition (int *row, int *column) |
Retrieve the current cursor position in the console window. | |
Variables | |
static bool | inputEchoDisabled = false |
static struct termios oldt | newt |
Implementation of the setcursorposition() and getcursorposition() functions for manipulating the cursor position on Windows terminals.
Definition in file cursor.c.
|
static |
Disable echoing of input and disable line input mode (where the Enter key must be entered to complete input).
Definition at line 64 of file cursor.c.
References inputEchoDisabled, and newt.
Referenced by Helpers::disableinputecho(), disableinputecho(), getcursorposition(), and Helpers::getcursorposition().
|
static |
Enable echoing of input.
Definition at line 89 of file cursor.c.
References inputEchoDisabled.
Referenced by Helpers::enableinputecho(), enableinputecho(), getcursorposition(), and Helpers::getcursorposition().
void disableinputecho | ( | void | ) |
Disable echoing input until enableinputecho() is called.
Definition at line 112 of file cursor.c.
References _disableInputEcho(), and inputEchoDisabled.
Referenced by Flyweight_Exercise().
void enableinputecho | ( | void | ) |
Enable echoing input, which should be the default mode. Call this only after calling disableinputecho();.
Definition at line 123 of file cursor.c.
References _enableInputEcho(), and inputEchoDisabled.
Referenced by Flyweight_Exercise().
void getcursorposition | ( | int * | row, |
int * | column | ||
) |
Retrieve the current cursor position in the console window.
row | Returns the row index from the top, starting at 0. |
column | Returns the column index from the left, starting at 0. |
Definition at line 143 of file cursor.c.
References _disableInputEcho(), _enableInputEcho(), inputEchoDisabled, split(), SplitList_Clear(), SplitList::strings, and SplitList::strings_count.
Referenced by Flyweight_Exercise().
void setcursorposition | ( | int | row, |
int | column | ||
) |
Move the text cursor to the specified screen coordinates.
row | Row index from top, starting at 0. |
column | Column index from left, starting at 0 |
Definition at line 134 of file cursor.c.
Referenced by Flyweight_Exercise().
|
static |
Definition at line 19 of file cursor.c.
Referenced by _disableInputEcho(), _enableInputEcho(), Helpers::disableinputecho(), disableinputecho(), Helpers::enableinputecho(), enableinputecho(), getcursorposition(), and Helpers::getcursorposition().
|
static |
Definition at line 26 of file cursor.c.
Referenced by _disableInputEcho().