Quellcode durchsuchen

Add insert/delete and document keys, and documentation.

tags/v0.9.3
Michael Brown vor 18 Jahren
Ursprung
Commit
2ae27f44d9
1 geänderte Dateien mit 19 neuen und 15 gelöschten Zeilen
  1. 19
    15
      src/include/gpxe/keys.h

+ 19
- 15
src/include/gpxe/keys.h Datei anzeigen

@@ -42,37 +42,41 @@
42 42
 
43 43
 #define BACKSPACE	CTRL_H
44 44
 #define TAB		CTRL_I
45
-#define ENTER		CTRL_M
45
+#define LF		CTRL_J
46
+#define CR		CTRL_M
46 47
 #define ESC		0x1b
47 48
 
48 49
 /*
49 50
  * Special keys outside the normal ASCII range 
50 51
  *
51 52
  *
52
- * These values are chosen to facilitate easy conversion from a
53
- * received ANSI escape sequence to a KEY_XXX constant.  The KEY_XXX
54
- * constant is simply 0x100 plus the first byte following CSI in the
55
- * ANSI escape sequence.  For example, KEY_LEFT is 0x144, since a left
56
- * cursor key is transmitted as the ANSI sequence "^[[D".
53
+ * The names are chosen to match those used by curses.  The values are
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".
57 59
  */
58 60
 
59 61
 #define KEY_ANSI( character ) ( 0x100 + (character) )
60 62
 
61 63
 #define KEY_MIN		0x101
62
-#define KEY_UP		KEY_ANSI ( 'A' )
63
-#define KEY_DOWN	KEY_ANSI ( 'B' )
64
-#define KEY_RIGHT	KEY_ANSI ( 'C' )
65
-#define KEY_LEFT	KEY_ANSI ( 'D' )
66
-#define KEY_END		KEY_ANSI ( 'E' )
67
-#define KEY_HOME	KEY_ANSI ( 'H' )
68
-#define KEY_PPAGE	KEY_ANSI ( '5' )
69
-#define KEY_NPAGE	KEY_ANSI ( '6' )
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 ( 'E' )	/**< 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 */
70 74
 #define KEY_MAX		0x1ff
71 75
 
72 76
 /* Not in the [KEY_MIN,KEY_MAX] range; terminals seem to send these as
73 77
  * normal ASCII values.
74 78
  */
75 79
 #define KEY_BACKSPACE	BACKSPACE
76
-#define KEY_ENTER	ENTER
80
+#define KEY_ENTER	LF
77 81
 
78 82
 #endif /* _GPXE_KEYS_H */

Laden…
Abbrechen
Speichern