10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
13 * Symbolic names for some standard ASCII characters
45 #define BACKSPACE CTRL_H
52 * Special keys outside the normal ASCII range
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.
60 #define KEY_ANSI( n, terminator ) ( 0x100 * ( (n) + 1 ) + (terminator) )
61 #define KEY_ANSI_N( key ) ( ( (key) / 0x100 ) - 1 )
62 #define KEY_ANSI_TERMINATOR( key ) ( (key) & 0xff )
65 #define KEY_UP KEY_ANSI ( 0, 'A' ) /**< Up arrow */
66 #define KEY_DOWN KEY_ANSI ( 0, 'B' ) /**< Down arrow */
67 #define KEY_RIGHT KEY_ANSI ( 0, 'C' ) /**< Right arrow */
68 #define KEY_LEFT KEY_ANSI ( 0, 'D' ) /**< Left arrow */
69 #define KEY_END KEY_ANSI ( 0, 'F' ) /**< End */
70 #define KEY_HOME KEY_ANSI ( 0, 'H' ) /**< Home */
71 #define KEY_IC KEY_ANSI ( 2, '~' ) /**< Insert */
72 #define KEY_DC KEY_ANSI ( 3, '~' ) /**< Delete */
73 #define KEY_PPAGE KEY_ANSI ( 5, '~' ) /**< Page up */
74 #define KEY_NPAGE KEY_ANSI ( 6, '~' ) /**< Page down */
75 #define KEY_F5 KEY_ANSI ( 15, '~' ) /**< F5 */
76 #define KEY_F6 KEY_ANSI ( 17, '~' ) /**< F6 */
77 #define KEY_F7 KEY_ANSI ( 18, '~' ) /**< F7 */
78 #define KEY_F8 KEY_ANSI ( 19, '~' ) /**< F8 (for PXE) */
79 #define KEY_F9 KEY_ANSI ( 20, '~' ) /**< F9 */
80 #define KEY_F10 KEY_ANSI ( 21, '~' ) /**< F10 */
81 #define KEY_F11 KEY_ANSI ( 23, '~' ) /**< F11 */
82 #define KEY_F12 KEY_ANSI ( 24, '~' ) /**< F12 */
84 /* Not in the [KEY_MIN,KEY_MAX] range; terminals seem to send these as
85 * normal ASCII values.
87 #define KEY_BACKSPACE BACKSPACE
90 #endif /* _IPXE_KEYS_H */