aboutsummaryrefslogtreecommitdiff
path: root/src/ncurses-test.c
blob: a34f5074f7afcebb7910d2aedd854bfd9cb4ee6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdlib.h>
#include <locale.h>
#include <ncurses.h>

int
main (int argc, char *argv[])
{
  initscr ();
  raw ();
  noecho ();
  keypad (stdscr, TRUE);

  printw ("Type any character to see it in bold\n");
  int ch = getch ();
  if(ch == KEY_F (1)) printw ("F1 Key pressed");
  else {
    printw ("The pressed key is ");
    attron (A_BOLD);
    printw ("%c", ch);
    attroff (A_BOLD);
  }
  refresh ();

  getch ();
  endwin ();

  return EXIT_SUCCESS;
}