diff options
| author | 2026-11-10 09:34:34 +0000 | |
|---|---|---|
| committer | 2026-11-10 09:34:34 +0000 | |
| commit | 3b539f06811a181249d6a154a5fce54d95ce9693 (patch) | |
| tree | 2117ff0f1c65ebfa94c27df288f3604762e65a73 /src/ncurses-test.c | |
| download | lab-05-master.tar.gz | |
Diffstat (limited to 'src/ncurses-test.c')
| -rw-r--r-- | src/ncurses-test.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ncurses-test.c b/src/ncurses-test.c new file mode 100644 index 0000000..a34f507 --- /dev/null +++ b/src/ncurses-test.c | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | #include <stdlib.h> | ||
| 2 | #include <locale.h> | ||
| 3 | #include <ncurses.h> | ||
| 4 | |||
| 5 | int | ||
| 6 | main (int argc, char *argv[]) | ||
| 7 | { | ||
| 8 | initscr (); | ||
| 9 | raw (); | ||
| 10 | noecho (); | ||
| 11 | keypad (stdscr, TRUE); | ||
| 12 | |||
| 13 | printw ("Type any character to see it in bold\n"); | ||
| 14 | int ch = getch (); | ||
| 15 | if(ch == KEY_F (1)) printw ("F1 Key pressed"); | ||
| 16 | else { | ||
| 17 | printw ("The pressed key is "); | ||
| 18 | attron (A_BOLD); | ||
| 19 | printw ("%c", ch); | ||
| 20 | attroff (A_BOLD); | ||
| 21 | } | ||
| 22 | refresh (); | ||
| 23 | |||
| 24 | getch (); | ||
| 25 | endwin (); | ||
| 26 | |||
| 27 | return EXIT_SUCCESS; | ||
| 28 | } | ||
