]>
Commit | Line | Data |
---|---|---|
2c40a813 | 1 | /*++\r |
2 | \r | |
f57387d5 HT |
3 | Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
2c40a813 | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | SimpleTextInputEx.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL from the UEFI 2.1 specification.\r | |
19 | \r | |
20 | This protocol defines an extension to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL\r | |
21 | which exposes much more state and modifier information from the input device,\r | |
22 | also allows one to register a notification for a particular keystroke.\r | |
23 | \r | |
24 | --*/\r | |
25 | \r | |
26 | #ifndef __SIMPLE_TEXT_INPUT_EX_H__\r | |
27 | #define __SIMPLE_TEXT_INPUT_EX_H__\r | |
28 | \r | |
29 | #include EFI_PROTOCOL_DEFINITION (SimpleTextIn)\r | |
30 | \r | |
31 | #define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \\r | |
32 | { \\r | |
7ccf38a3 | 33 | 0xdd9e7534, 0x7762, 0x4698, {0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa}\\r |
2c40a813 | 34 | }\r |
35 | \r | |
36 | EFI_FORWARD_DECLARATION (EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL);\r | |
37 | \r | |
38 | //\r | |
39 | // Data structures\r | |
40 | //\r | |
41 | \r | |
42 | typedef UINT8 EFI_KEY_TOGGLE_STATE;\r | |
43 | // \r | |
44 | // Any Shift or Toggle State that is valid should have \r | |
45 | // high order bit set.\r | |
46 | //\r | |
47 | typedef struct EFI_KEY_STATE {\r | |
48 | UINT32 KeyShiftState;\r | |
49 | EFI_KEY_TOGGLE_STATE KeyToggleState;\r | |
50 | } EFI_KEY_STATE;\r | |
51 | \r | |
52 | typedef struct {\r | |
53 | EFI_INPUT_KEY Key; \r | |
54 | EFI_KEY_STATE KeyState; \r | |
55 | } EFI_KEY_DATA;\r | |
56 | \r | |
57 | //\r | |
58 | // Shift state\r | |
59 | //\r | |
60 | #define EFI_SHIFT_STATE_VALID 0x80000000\r | |
61 | #define EFI_RIGHT_SHIFT_PRESSED 0x00000001\r | |
62 | #define EFI_LEFT_SHIFT_PRESSED 0x00000002\r | |
63 | #define EFI_RIGHT_CONTROL_PRESSED 0x00000004\r | |
64 | #define EFI_LEFT_CONTROL_PRESSED 0x00000008\r | |
65 | #define EFI_RIGHT_ALT_PRESSED 0x00000010\r | |
66 | #define EFI_LEFT_ALT_PRESSED 0x00000020\r | |
67 | #define EFI_RIGHT_LOGO_PRESSED 0x00000040\r | |
68 | #define EFI_LEFT_LOGO_PRESSED 0x00000080\r | |
69 | #define EFI_MENU_KEY_PRESSED 0x00000100\r | |
70 | #define EFI_SYS_REQ_PRESSED 0x00000200\r | |
71 | \r | |
72 | // \r | |
73 | // Toggle state \r | |
74 | // \r | |
75 | #define EFI_TOGGLE_STATE_VALID 0x80\r | |
76 | #define EFI_SCROLL_LOCK_ACTIVE 0x01\r | |
77 | #define EFI_NUM_LOCK_ACTIVE 0x02\r | |
78 | #define EFI_CAPS_LOCK_ACTIVE 0x04\r | |
79 | \r | |
80 | // \r | |
81 | // EFI Scan codes \r | |
82 | // \r | |
83 | #define SCAN_F13 0x0068\r | |
84 | #define SCAN_F14 0x0069\r | |
85 | #define SCAN_F15 0x006A\r | |
86 | #define SCAN_F16 0x006B\r | |
87 | #define SCAN_F17 0x006C\r | |
88 | #define SCAN_F18 0x006D\r | |
89 | #define SCAN_F19 0x006E\r | |
90 | #define SCAN_F20 0x006F\r | |
91 | #define SCAN_F21 0x0070\r | |
92 | #define SCAN_F22 0x0071\r | |
93 | #define SCAN_F23 0x0072\r | |
94 | #define SCAN_F24 0x0073\r | |
95 | #define SCAN_MUTE 0x007F\r | |
96 | #define SCAN_VOLUME_UP 0x0080\r | |
97 | #define SCAN_VOLUME_DOWN 0x0081\r | |
98 | #define SCAN_BRIGHTNESS_UP 0x0100\r | |
99 | #define SCAN_BRIGHTNESS_DOWN 0x0101\r | |
100 | #define SCAN_SUSPEND 0x0102\r | |
101 | #define SCAN_HIBERNATE 0x0103\r | |
102 | #define SCAN_TOGGLE_DISPLAY 0x0104\r | |
103 | #define SCAN_RECOVERY 0x0105\r | |
104 | #define SCAN_EJECT 0x0106\r | |
105 | \r | |
106 | \r | |
107 | //\r | |
108 | // EFI Key Notfication Function\r | |
109 | //\r | |
110 | typedef \r | |
111 | EFI_STATUS\r | |
112 | (EFIAPI *EFI_KEY_NOTIFY_FUNCTION) (\r | |
113 | IN EFI_KEY_DATA *KeyData\r | |
e00e1d46 | 114 | );\r |
2c40a813 | 115 | \r |
116 | typedef\r | |
117 | EFI_STATUS\r | |
118 | (EFIAPI *EFI_INPUT_RESET_EX) (\r | |
119 | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r | |
120 | IN BOOLEAN ExtendedVerification\r | |
121 | )\r | |
122 | /*++\r | |
123 | \r | |
124 | Routine Description:\r | |
125 | Reset the input device and optionaly run diagnostics\r | |
126 | \r | |
127 | Arguments:\r | |
128 | This - Protocol instance pointer.\r | |
129 | ExtendedVerification - Driver may perform diagnostics on reset.\r | |
130 | \r | |
131 | Returns:\r | |
132 | EFI_SUCCESS - The device was reset.\r | |
133 | EFI_DEVICE_ERROR - The device is not functioning properly and could \r | |
134 | not be reset.\r | |
135 | \r | |
136 | --*/\r | |
137 | ;\r | |
138 | \r | |
139 | typedef\r | |
140 | EFI_STATUS\r | |
141 | (EFIAPI *EFI_INPUT_READ_KEY_EX) (\r | |
142 | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r | |
143 | OUT EFI_KEY_DATA *KeyData\r | |
144 | )\r | |
145 | /*++\r | |
146 | \r | |
147 | Routine Description:\r | |
148 | Reads the next keystroke from the input device. The WaitForKey Event can \r | |
149 | be used to test for existance of a keystroke via WaitForEvent () call.\r | |
150 | \r | |
151 | Arguments:\r | |
152 | This - Protocol instance pointer.\r | |
153 | KeyData - A pointer to a buffer that is filled in with the keystroke \r | |
154 | state data for the key that was pressed.\r | |
155 | \r | |
156 | Returns:\r | |
157 | EFI_SUCCESS - The keystroke information was returned.\r | |
158 | EFI_NOT_READY - There was no keystroke data availiable.\r | |
159 | EFI_DEVICE_ERROR - The keystroke information was not returned due to \r | |
160 | hardware errors.\r | |
161 | EFI_INVALID_PARAMETER - KeyData is NULL. \r | |
162 | --*/\r | |
163 | ;\r | |
164 | \r | |
165 | typedef\r | |
166 | EFI_STATUS\r | |
167 | (EFIAPI *EFI_SET_STATE) (\r | |
168 | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r | |
169 | IN EFI_KEY_TOGGLE_STATE *KeyToggleState\r | |
170 | )\r | |
171 | /*++\r | |
172 | \r | |
173 | Routine Description:\r | |
174 | Set certain state for the input device.\r | |
175 | \r | |
176 | Arguments:\r | |
177 | This - Protocol instance pointer.\r | |
178 | KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the \r | |
179 | state for the input device.\r | |
180 | \r | |
181 | Returns:\r | |
182 | EFI_SUCCESS - The device state was set successfully.\r | |
183 | EFI_DEVICE_ERROR - The device is not functioning correctly and could \r | |
184 | not have the setting adjusted.\r | |
185 | EFI_UNSUPPORTED - The device does not have the ability to set its state.\r | |
186 | EFI_INVALID_PARAMETER - KeyToggleState is NULL. \r | |
187 | \r | |
188 | --*/ \r | |
189 | ;\r | |
190 | \r | |
191 | typedef\r | |
192 | EFI_STATUS\r | |
193 | (EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) (\r | |
194 | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r | |
195 | IN EFI_KEY_DATA *KeyData,\r | |
196 | IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,\r | |
197 | OUT EFI_HANDLE *NotifyHandle\r | |
198 | )\r | |
199 | /*++\r | |
200 | \r | |
201 | Routine Description:\r | |
202 | Register a notification function for a particular keystroke for the input device.\r | |
203 | \r | |
204 | Arguments:\r | |
205 | This - Protocol instance pointer.\r | |
206 | KeyData - A pointer to a buffer that is filled in with the keystroke \r | |
207 | information data for the key that was pressed.\r | |
208 | KeyNotificationFunction - Points to the function to be called when the key \r | |
209 | sequence is typed specified by KeyData. \r | |
210 | NotifyHandle - Points to the unique handle assigned to the registered notification. \r | |
211 | \r | |
212 | Returns:\r | |
213 | EFI_SUCCESS - The notification function was registered successfully.\r | |
214 | EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.\r | |
215 | EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL. \r | |
216 | \r | |
217 | --*/ \r | |
218 | ;\r | |
219 | \r | |
220 | typedef\r | |
221 | EFI_STATUS\r | |
222 | (EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) (\r | |
223 | IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r | |
224 | IN EFI_HANDLE NotificationHandle\r | |
225 | )\r | |
226 | /*++\r | |
227 | \r | |
228 | Routine Description:\r | |
229 | Remove a registered notification function from a particular keystroke.\r | |
230 | \r | |
231 | Arguments:\r | |
232 | This - Protocol instance pointer. \r | |
233 | NotificationHandle - The handle of the notification function being unregistered.\r | |
234 | \r | |
235 | Returns:\r | |
236 | EFI_SUCCESS - The notification function was unregistered successfully.\r | |
237 | EFI_INVALID_PARAMETER - The NotificationHandle is invalid.\r | |
238 | EFI_NOT_FOUND - Can not find the matching entry in database. \r | |
239 | \r | |
240 | --*/ \r | |
241 | ;\r | |
242 | \r | |
e5bce275 | 243 | struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL {\r |
2c40a813 | 244 | EFI_INPUT_RESET_EX Reset;\r |
245 | EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx;\r | |
246 | EFI_EVENT WaitForKeyEx;\r | |
247 | EFI_SET_STATE SetState;\r | |
248 | EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify;\r | |
249 | EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify;\r | |
e5bce275 | 250 | };\r |
2c40a813 | 251 | \r |
252 | extern EFI_GUID gEfiSimpleTextInputExProtocolGuid;\r | |
253 | \r | |
254 | #endif\r |