浏览代码

Key definitions

tags/v0.9.3
Michael Brown 18 年前
父节点
当前提交
96a1a2c6f0
共有 1 个文件被更改,包括 78 次插入0 次删除
  1. 78
    0
      src/include/gpxe/keys.h

+ 78
- 0
src/include/gpxe/keys.h 查看文件

@@ -0,0 +1,78 @@
1
+#ifndef _GPXE_KEYS_H
2
+#define _GPXE_KEYS_H
3
+
4
+/** @file
5
+ *
6
+ * Key definitions
7
+ *
8
+ */
9
+
10
+/*
11
+ * Symbolic names for some standard ASCII characters
12
+ *
13
+ */
14
+
15
+#define NUL		0x00
16
+#define CTRL_A		0x01
17
+#define CTRL_B		0x02
18
+#define CTRL_C		0x03
19
+#define CTRL_D		0x04
20
+#define CTRL_E		0x05
21
+#define CTRL_F		0x06
22
+#define CTRL_G		0x07
23
+#define CTRL_H		0x08
24
+#define CTRL_I		0x09
25
+#define CTRL_J		0x0a
26
+#define CTRL_K		0x0b
27
+#define CTRL_L		0x0c
28
+#define CTRL_M		0x0d
29
+#define CTRL_N		0x0e
30
+#define CTRL_O		0x0f
31
+#define CTRL_P		0x10
32
+#define CTRL_Q		0x11
33
+#define CTRL_R		0x12
34
+#define CTRL_S		0x13
35
+#define CTRL_T		0x14
36
+#define CTRL_U		0x15
37
+#define CTRL_V		0x16
38
+#define CTRL_W		0x17
39
+#define CTRL_X		0x18
40
+#define CTRL_Y		0x19
41
+#define CTRL_Z		0x1a
42
+
43
+#define BACKSPACE	CTRL_H
44
+#define TAB		CTRL_I
45
+#define ENTER		CTRL_M
46
+#define ESC		0x1b
47
+
48
+/*
49
+ * Special keys outside the normal ASCII range 
50
+ *
51
+ *
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".
57
+ */
58
+
59
+#define KEY_ANSI( character ) ( 0x100 + (character) )
60
+
61
+#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' )
70
+#define KEY_MAX		0x1ff
71
+
72
+/* Not in the [KEY_MIN,KEY_MAX] range; terminals seem to send these as
73
+ * normal ASCII values.
74
+ */
75
+#define KEY_BACKSPACE	BACKSPACE
76
+#define KEY_ENTER	ENTER
77
+
78
+#endif /* _GPXE_KEYS_H */

正在加载...
取消
保存