Skip to content

Instantly share code, notes, and snippets.

@BOOtak
Created June 10, 2018 23:45
Show Gist options
  • Save BOOtak/335df7165c6eee2099a8f3164d217b16 to your computer and use it in GitHub Desktop.
Save BOOtak/335df7165c6eee2099a8f3164d217b16 to your computer and use it in GitHub Desktop.
#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