Created
June 10, 2018 23:45
-
-
Save BOOtak/335df7165c6eee2099a8f3164d217b16 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ncurses.h> | |
#include <thread> | |
#define CURSOR_INVISIBLE 0 | |
int main() { | |
keypad(stdscr, true); | |
nodelay(stdscr, true); | |
initscr(); | |
curs_set(CURSOR_INVISIBLE); | |
cbreak(); | |
noecho(); | |
const std::chrono::microseconds sleepInterval(1000 * 1000); | |
for (int x = 0;;) { | |
std::this_thread::sleep_for(sleepInterval); | |
int ch = getch(); | |
if (ch != ERR) { | |
mvaddch(0, x++, ch); | |
} | |
refresh(); | |
} | |
endwin(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment