source: trunk/ncurses/test/keynames.c@ 3003

Last change on this file since 3003 was 2621, checked in by bird, 19 years ago

GNU ncurses 5.5

File size: 615 bytes
Line 
1/*
2 * $Id: keynames.c,v 1.7 2005/04/30 20:13:59 tom Exp $
3 */
4
5#include <test.priv.h>
6
7int
8main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
9{
10 int n;
11
12 /*
13 * Get the terminfo entry into memory, and tell ncurses that we want to
14 * use function keys. That will make it add any user-defined keys that
15 * appear in the terminfo.
16 */
17 newterm(getenv("TERM"), stderr, stdin);
18 keypad(stdscr, TRUE);
19 endwin();
20
21 for (n = -1; n < KEY_MAX + 512; n++) {
22 const char *result = keyname(n);
23 if (result != 0)
24 printf("%d(%5o):%s\n", n, n, result);
25 }
26 ExitProgram(EXIT_SUCCESS);
27}
Note: See TracBrowser for help on using the repository browser.