]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
c8c44377 | 2 | Simple Text Input protocol from the UEFI 2.0 specification.\r |
d1f95000 | 3 | \r |
4 | Abstraction of a very simple input device like a keyboard or serial\r | |
5 | terminal.\r | |
6 | \r | |
2be21afb | 7 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r |
850f13eb | 8 | This program and the accompanying materials\r |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
d1f95000 | 12 | \r |
850f13eb | 13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
d1f95000 | 15 | \r |
d1f95000 | 16 | **/\r |
17 | \r | |
18 | #ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__\r | |
19 | #define __SIMPLE_TEXT_IN_PROTOCOL_H__\r | |
20 | \r | |
a6508c05 | 21 | #define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \\r |
d1f95000 | 22 | { \\r |
23 | 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r | |
24 | }\r | |
25 | \r | |
992f22b9 LG |
26 | typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;\r |
27 | \r | |
99e8ed21 | 28 | ///\r |
992f22b9 | 29 | /// Protocol GUID name defined in EFI1.1.\r |
850f13eb | 30 | ///\r |
a6508c05 | 31 | #define SIMPLE_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID\r |
d1f95000 | 32 | \r |
99e8ed21 | 33 | ///\r |
992f22b9 | 34 | /// Protocol name in EFI1.1 for backward-compatible.\r |
850f13eb | 35 | ///\r |
a6508c05 | 36 | typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL SIMPLE_INPUT_INTERFACE;\r |
992f22b9 LG |
37 | \r |
38 | ///\r | |
39 | /// The keystroke information for the key that was pressed.\r | |
40 | ///\r | |
d1f95000 | 41 | typedef struct {\r |
42 | UINT16 ScanCode;\r | |
43 | CHAR16 UnicodeChar;\r | |
44 | } EFI_INPUT_KEY;\r | |
45 | \r | |
46 | //\r | |
47 | // Required unicode control chars\r | |
48 | //\r | |
49 | #define CHAR_NULL 0x0000\r | |
50 | #define CHAR_BACKSPACE 0x0008\r | |
51 | #define CHAR_TAB 0x0009\r | |
52 | #define CHAR_LINEFEED 0x000A\r | |
53 | #define CHAR_CARRIAGE_RETURN 0x000D\r | |
54 | \r | |
55 | //\r | |
56 | // EFI Scan codes\r | |
57 | //\r | |
58 | #define SCAN_NULL 0x0000\r | |
59 | #define SCAN_UP 0x0001\r | |
60 | #define SCAN_DOWN 0x0002\r | |
61 | #define SCAN_RIGHT 0x0003\r | |
62 | #define SCAN_LEFT 0x0004\r | |
63 | #define SCAN_HOME 0x0005\r | |
64 | #define SCAN_END 0x0006\r | |
65 | #define SCAN_INSERT 0x0007\r | |
66 | #define SCAN_DELETE 0x0008\r | |
67 | #define SCAN_PAGE_UP 0x0009\r | |
68 | #define SCAN_PAGE_DOWN 0x000A\r | |
69 | #define SCAN_F1 0x000B\r | |
70 | #define SCAN_F2 0x000C\r | |
71 | #define SCAN_F3 0x000D\r | |
72 | #define SCAN_F4 0x000E\r | |
73 | #define SCAN_F5 0x000F\r | |
74 | #define SCAN_F6 0x0010\r | |
75 | #define SCAN_F7 0x0011\r | |
76 | #define SCAN_F8 0x0012\r | |
77 | #define SCAN_F9 0x0013\r | |
78 | #define SCAN_F10 0x0014\r | |
d1f95000 | 79 | #define SCAN_ESC 0x0017\r |
80 | \r | |
81 | /**\r | |
6e55477d | 82 | Reset the input device and optionally run diagnostics\r |
d1f95000 | 83 | \r |
84 | @param This Protocol instance pointer.\r | |
85 | @param ExtendedVerification Driver may perform diagnostics on reset.\r | |
86 | \r | |
87 | @retval EFI_SUCCESS The device was reset.\r | |
88 | @retval EFI_DEVICE_ERROR The device is not functioning properly and could not be reset.\r | |
89 | \r | |
90 | **/\r | |
91 | typedef\r | |
92 | EFI_STATUS\r | |
8b13229b | 93 | (EFIAPI *EFI_INPUT_RESET)(\r |
a6508c05 | 94 | IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,\r |
d1f95000 | 95 | IN BOOLEAN ExtendedVerification\r |
ed66e1bc | 96 | );\r |
d1f95000 | 97 | \r |
98 | /**\r | |
850f13eb | 99 | Reads the next keystroke from the input device. The WaitForKey Event can\r |
6e55477d | 100 | be used to test for existence of a keystroke via WaitForEvent () call.\r |
d1f95000 | 101 | \r |
850f13eb | 102 | @param This Protocol instance pointer.\r |
103 | @param Key A pointer to a buffer that is filled in with the keystroke\r | |
104 | information for the key that was pressed.\r | |
d1f95000 | 105 | \r |
106 | @retval EFI_SUCCESS The keystroke information was returned.\r | |
6e55477d | 107 | @retval EFI_NOT_READY There was no keystroke data available.\r |
108 | @retval EFI_DEVICE_ERROR The keystroke information was not returned due to\r | |
d1f95000 | 109 | hardware errors.\r |
110 | \r | |
111 | **/\r | |
112 | typedef\r | |
113 | EFI_STATUS\r | |
8b13229b | 114 | (EFIAPI *EFI_INPUT_READ_KEY)(\r |
a6508c05 | 115 | IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,\r |
d1f95000 | 116 | OUT EFI_INPUT_KEY *Key\r |
ed66e1bc | 117 | );\r |
d1f95000 | 118 | \r |
44717a39 | 119 | ///\r |
850f13eb | 120 | /// The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.\r |
44717a39 | 121 | /// It is the minimum required protocol for ConsoleIn.\r |
122 | ///\r | |
a6508c05 | 123 | struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {\r |
d1f95000 | 124 | EFI_INPUT_RESET Reset;\r |
125 | EFI_INPUT_READ_KEY ReadKeyStroke;\r | |
1f08a159 | 126 | ///\r |
127 | /// Event to use with WaitForEvent() to wait for a key to be available\r | |
128 | ///\r | |
d1f95000 | 129 | EFI_EVENT WaitForKey;\r |
130 | };\r | |
131 | \r | |
132 | extern EFI_GUID gEfiSimpleTextInProtocolGuid;\r | |
133 | \r | |
134 | #endif\r |