|
@@ -52,26 +52,23 @@
|
52
|
52
|
*
|
53
|
53
|
* The names are chosen to match those used by curses. The values are
|
54
|
54
|
* chosen to facilitate easy conversion from a received ANSI escape
|
55
|
|
- * sequence to a KEY_XXX constant. The KEY_XXX constant is simply
|
56
|
|
- * 0x100 plus the first byte following CSI in the ANSI escape
|
57
|
|
- * sequence. For example, KEY_LEFT is 0x144, since a left cursor key
|
58
|
|
- * is transmitted as the ANSI sequence "^[[D".
|
|
55
|
+ * sequence to a KEY_XXX constant.
|
59
|
56
|
*/
|
60
|
57
|
|
61
|
|
-#define KEY_ANSI( character ) ( 0x100 + (character) )
|
|
58
|
+#define KEY_ANSI( n, terminator ) ( 0x100 * ( (n) + 1 ) + (terminator) )
|
62
|
59
|
|
63
|
60
|
#define KEY_MIN 0x101
|
64
|
|
-#define KEY_UP KEY_ANSI ( 'A' ) /**< Up arrow */
|
65
|
|
-#define KEY_DOWN KEY_ANSI ( 'B' ) /**< Down arrow */
|
66
|
|
-#define KEY_RIGHT KEY_ANSI ( 'C' ) /**< Right arrow */
|
67
|
|
-#define KEY_LEFT KEY_ANSI ( 'D' ) /**< Left arrow */
|
68
|
|
-#define KEY_END KEY_ANSI ( 'F' ) /**< End */
|
69
|
|
-#define KEY_HOME KEY_ANSI ( 'H' ) /**< Home */
|
70
|
|
-#define KEY_IC KEY_ANSI ( '2' ) /**< Insert */
|
71
|
|
-#define KEY_DC KEY_ANSI ( '3' ) /**< Delete */
|
72
|
|
-#define KEY_PPAGE KEY_ANSI ( '5' ) /**< Page up */
|
73
|
|
-#define KEY_NPAGE KEY_ANSI ( '6' ) /**< Page down */
|
74
|
|
-#define KEY_MAX 0x1ff
|
|
61
|
+#define KEY_UP KEY_ANSI ( 0, 'A' ) /**< Up arrow */
|
|
62
|
+#define KEY_DOWN KEY_ANSI ( 0, 'B' ) /**< Down arrow */
|
|
63
|
+#define KEY_RIGHT KEY_ANSI ( 0, 'C' ) /**< Right arrow */
|
|
64
|
+#define KEY_LEFT KEY_ANSI ( 0, 'D' ) /**< Left arrow */
|
|
65
|
+#define KEY_END KEY_ANSI ( 0, 'F' ) /**< End */
|
|
66
|
+#define KEY_HOME KEY_ANSI ( 0, 'H' ) /**< Home */
|
|
67
|
+#define KEY_IC KEY_ANSI ( 2, '~' ) /**< Insert */
|
|
68
|
+#define KEY_DC KEY_ANSI ( 3, '~' ) /**< Delete */
|
|
69
|
+#define KEY_PPAGE KEY_ANSI ( 5, '~' ) /**< Page up */
|
|
70
|
+#define KEY_NPAGE KEY_ANSI ( 6, '~' ) /**< Page down */
|
|
71
|
+#define KEY_F8 KEY_ANSI ( 19, '~' ) /**< F8 (for PXE) */
|
75
|
72
|
|
76
|
73
|
/* Not in the [KEY_MIN,KEY_MAX] range; terminals seem to send these as
|
77
|
74
|
* normal ASCII values.
|