54 lines
913 B
C
54 lines
913 B
C
#include <ncurses.h>
|
|
|
|
// void init_colors() {
|
|
// start_color();
|
|
// init_pair(1, COLOR_GREEN, COLOR_BLACK);
|
|
// init_pair(2, COLOR_CYAN, COLOR_BLACK);
|
|
// init_pair(3, COLOR_MAGENTA, COLOR_BLACK);
|
|
// init_pair(4, COLOR_YELLOW, COLOR_BLACK);
|
|
// }
|
|
|
|
// int main(void) {
|
|
// initscr();
|
|
// printw("Goodbye World...");
|
|
// refresh();
|
|
// getch();
|
|
// endwin();
|
|
|
|
// return 0;
|
|
// }
|
|
|
|
int main(void) {
|
|
initscr();
|
|
raw();
|
|
// cbreak();
|
|
// noecho();
|
|
// echo();
|
|
// curs_set(0);
|
|
keypad(stdscr, TRUE); // enable F1, F2, etc
|
|
noecho();
|
|
// nodelay(stdscr, TRUE);
|
|
|
|
// getmaxyx(stdscr, max_y, max_x);
|
|
// init_colors();
|
|
printw("Type: ");
|
|
refresh();
|
|
|
|
int ch;
|
|
while (1) {
|
|
ch = getch();
|
|
if (ch == KEY_F(1)) {
|
|
printw("[!] F1\n");
|
|
break;
|
|
}
|
|
|
|
attron(A_BOLD);
|
|
printw("%c", ch);
|
|
attroff(A_BOLD);
|
|
refresh();
|
|
// napms(50);
|
|
}
|
|
|
|
endwin();
|
|
return 0;
|
|
}
|