Terminal interface for communicating with serial ANSI/VT100 terminals
Revision 3:169909f7566f, committed 2019-12-13
- Comitter:
- lpiwowar
- Date:
- Fri Dec 13 10:10:21 2019 +0000
- Parent:
- 2:85184c13476c
- Commit message:
- Initial commi
Changed in this revision
Terminal.cpp | Show annotated file Show diff for this revision Revisions of this file |
Terminal.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Terminal.cpp Tue Nov 23 16:03:35 2010 +0000 +++ b/Terminal.cpp Fri Dec 13 10:10:21 2019 +0000 @@ -55,3 +55,19 @@ int c = 40 + rgb888tobgr111(colour); this->printf("\033[%dm", c); } + +void Terminal::move_cursor_up(int step_num) { + this->printf("\033[%dA", step_num); +} + +void Terminal::move_cursor_down(int step_num) { + this->printf("\033[%dB", step_num); +} + +void Terminal::move_cursor_right(int step_num) { + this->printf("\033[%dC", step_num); +} + +void Terminal::move_cursor_left(int step_num) { + this->printf("\033[%dD", step_num); +}
--- a/Terminal.h Tue Nov 23 16:03:35 2010 +0000 +++ b/Terminal.h Fri Dec 13 10:10:21 2019 +0000 @@ -64,7 +64,19 @@ /** Clear the screen and locate to 0,0 */ void cls(); - + + /** Moves cursor up by @var step_num */ + void move_cursor_up(int step_num); + + /** Moves cursor down by @var step_num */ + void move_cursor_down(int step_num); + + /** Moves cursor righ by @var step_num */ + void move_cursor_right(int step_num); + + /** Move cursor left by @var step_num */ + void move_cursor_left(int step_num); + /** Set the foreground colour */ void foreground(int colour);