aboutsummaryrefslogtreecommitdiff
path: root/src/ncurses-test.c
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-10 09:34:34 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-10 09:34:34 +0000
commit3b539f06811a181249d6a154a5fce54d95ce9693 (patch)
tree2117ff0f1c65ebfa94c27df288f3604762e65a73 /src/ncurses-test.c
downloadlab-05-master.tar.gz
publishHEADmaster
Diffstat (limited to 'src/ncurses-test.c')
-rw-r--r--src/ncurses-test.c28
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
5int
6main (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}