summaryrefslogtreecommitdiff
path: root/c/key.c
blob: 74379f62443efdc9135eb0b0250fa15de3193299 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <ncurses.h>
int main() {
  initscr();
  cbreak();
  noecho();

  printw("press h to do something, and q to quit.\n");

  int ch;
  while ((ch = getch()) != 'q') {
    if (ch == 'h') {
      printw("yep thats h\n");
    }
  }

  endwin();
  return 0;
}