• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _GPXE_KEYS_H
2 #define _GPXE_KEYS_H
3 
4 /** @file
5  *
6  * Key definitions
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER );
11 
12 /*
13  * Symbolic names for some standard ASCII characters
14  *
15  */
16 
17 #define NUL		0x00
18 #define CTRL_A		0x01
19 #define CTRL_B		0x02
20 #define CTRL_C		0x03
21 #define CTRL_D		0x04
22 #define CTRL_E		0x05
23 #define CTRL_F		0x06
24 #define CTRL_G		0x07
25 #define CTRL_H		0x08
26 #define CTRL_I		0x09
27 #define CTRL_J		0x0a
28 #define CTRL_K		0x0b
29 #define CTRL_L		0x0c
30 #define CTRL_M		0x0d
31 #define CTRL_N		0x0e
32 #define CTRL_O		0x0f
33 #define CTRL_P		0x10
34 #define CTRL_Q		0x11
35 #define CTRL_R		0x12
36 #define CTRL_S		0x13
37 #define CTRL_T		0x14
38 #define CTRL_U		0x15
39 #define CTRL_V		0x16
40 #define CTRL_W		0x17
41 #define CTRL_X		0x18
42 #define CTRL_Y		0x19
43 #define CTRL_Z		0x1a
44 
45 #define BACKSPACE	CTRL_H
46 #define TAB		CTRL_I
47 #define LF		CTRL_J
48 #define CR		CTRL_M
49 #define ESC		0x1b
50 
51 /*
52  * Special keys outside the normal ASCII range
53  *
54  *
55  * The names are chosen to match those used by curses.  The values are
56  * chosen to facilitate easy conversion from a received ANSI escape
57  * sequence to a KEY_XXX constant.
58  */
59 
60 #define KEY_ANSI( n, terminator ) ( 0x100 * ( (n) + 1 ) + (terminator) )
61 
62 #define KEY_MIN		0x101
63 #define KEY_UP		KEY_ANSI ( 0, 'A' )	/**< Up arrow */
64 #define KEY_DOWN	KEY_ANSI ( 0, 'B' )	/**< Down arrow */
65 #define KEY_RIGHT	KEY_ANSI ( 0, 'C' )	/**< Right arrow */
66 #define KEY_LEFT	KEY_ANSI ( 0, 'D' )	/**< Left arrow */
67 #define KEY_END		KEY_ANSI ( 0, 'F' )	/**< End */
68 #define KEY_HOME	KEY_ANSI ( 0, 'H' )	/**< Home */
69 #define KEY_IC		KEY_ANSI ( 2, '~' )	/**< Insert */
70 #define KEY_DC		KEY_ANSI ( 3, '~' )	/**< Delete */
71 #define KEY_PPAGE	KEY_ANSI ( 5, '~' )	/**< Page up */
72 #define KEY_NPAGE	KEY_ANSI ( 6, '~' )	/**< Page down */
73 #define KEY_F8		KEY_ANSI ( 19, '~' )	/**< F8 (for PXE) */
74 
75 /* Not in the [KEY_MIN,KEY_MAX] range; terminals seem to send these as
76  * normal ASCII values.
77  */
78 #define KEY_BACKSPACE	BACKSPACE
79 #define KEY_ENTER	LF
80 
81 #endif /* _GPXE_KEYS_H */
82