Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Terminal by
Revision 9:45fba42a98aa, committed 2017-07-06
- Comitter:
- CheezyArmpit
- Date:
- Thu Jul 06 13:17:38 2017 +0000
- Parent:
- 8:9ab22fc6e88b
- Commit message:
- Combines cursor show/hide; locate fix and Justin Jordans various additions
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 |
diff -r 9ab22fc6e88b -r 45fba42a98aa Terminal.cpp --- a/Terminal.cpp Sat Mar 25 19:10:15 2017 +0000 +++ b/Terminal.cpp Thu Jul 06 13:17:38 2017 +0000 @@ -34,7 +34,7 @@ void Terminal::locate(int column, int row) { // Cursor Home <ESC>[{ROW};{COLUMN}H - this->printf("\033[%d;%dH%c", row + 1, column + 1); + this->printf("\033[%d;%dH", row + 1, column + 1); } static int rgb888tobgr111(int colour) { @@ -219,3 +219,13 @@ return(user_input); } + +void Terminal::hideCursor() { + //Hide cursor from terminal + this->printf("\033[?25l"); +} + +void Terminal::showCursor() { + //Hide cursor from terminal + this->printf("\33[[?25h"); +}
diff -r 9ab22fc6e88b -r 45fba42a98aa Terminal.h --- a/Terminal.h Sat Mar 25 19:10:15 2017 +0000 +++ b/Terminal.h Thu Jul 06 13:17:38 2017 +0000 @@ -75,6 +75,12 @@ /** Set the background colour */ void background(int colour); + /** Hide Cursor from terminal*/ + void hideCursor(); + + /** Hide Cursor from terminal*/ + void showCursor(); + /** Get integer value from user * * @param msg - User prompt