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