1 #ident "$Id: keytest.c,v 1.4 2004/12/21 23:31:45 hpa Exp $"
2 /* ----------------------------------------------------------------------- *
4 * Copyright 2004 H. Peter Anvin - All Rights Reserved
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 * Boston MA 02111-1307, USA; either version 2 of the License, or
10 * (at your option) any later version; incorporated herein by reference.
12 * ----------------------------------------------------------------------- */
17 * Test the key parsing library
24 #include <sys/times.h>
26 #include <consoles.h> /* Provided by libutil */
29 static void cooked_keys(void)
36 key = get_key(stdin, 0);
41 } else if ( key == '?' )
44 if ( key >= 0x20 && key < 0x100 ) {
47 printf("[%04x]", key);
52 static void raw_keys(void)
64 } else if ( key == '!' )
67 printf("<%02x>", key);
75 printf("CLK_TCK = %d\n", (int)CLK_TCK);
76 printf("Press keys, end with Ctrl-C...\n");