iPXE
SimpleTextIn.h
Go to the documentation of this file.
1/** @file
2 Simple Text Input protocol from the UEFI 2.0 specification.
3
4 Abstraction of a very simple input device like a keyboard or serial
5 terminal.
6
7 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10**/
11
12#pragma once
13
14FILE_LICENCE ( BSD2_PATENT );
15FILE_SECBOOT ( PERMITTED );
16
17#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
18 { \
19 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
20 }
21
23
24///
25/// Protocol GUID name defined in EFI1.1.
26///
27#define SIMPLE_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
28
29///
30/// Protocol name in EFI1.1 for backward-compatible.
31///
33
34///
35/// The keystroke information for the key that was pressed.
36///
41
42//
43// Required unicode control chars
44//
45#define CHAR_BACKSPACE 0x0008
46#define CHAR_TAB 0x0009
47#define CHAR_LINEFEED 0x000A
48#define CHAR_CARRIAGE_RETURN 0x000D
49
50//
51// EFI Scan codes
52//
53#define SCAN_NULL 0x0000
54#define SCAN_UP 0x0001
55#define SCAN_DOWN 0x0002
56#define SCAN_RIGHT 0x0003
57#define SCAN_LEFT 0x0004
58#define SCAN_HOME 0x0005
59#define SCAN_END 0x0006
60#define SCAN_INSERT 0x0007
61#define SCAN_DELETE 0x0008
62#define SCAN_PAGE_UP 0x0009
63#define SCAN_PAGE_DOWN 0x000A
64#define SCAN_F1 0x000B
65#define SCAN_F2 0x000C
66#define SCAN_F3 0x000D
67#define SCAN_F4 0x000E
68#define SCAN_F5 0x000F
69#define SCAN_F6 0x0010
70#define SCAN_F7 0x0011
71#define SCAN_F8 0x0012
72#define SCAN_F9 0x0013
73#define SCAN_F10 0x0014
74#define SCAN_ESC 0x0017
75
76/**
77 Reset the input device and optionally run diagnostics
78
79 @param This Protocol instance pointer.
80 @param ExtendedVerification Driver may perform diagnostics on reset.
81
82 @retval EFI_SUCCESS The device was reset.
83 @retval EFI_DEVICE_ERROR The device is not functioning properly and could not be reset.
84
85**/
86typedef
90 IN BOOLEAN ExtendedVerification
91 );
92
93/**
94 Reads the next keystroke from the input device. The WaitForKey Event can
95 be used to test for existence of a keystroke via WaitForEvent () call.
96
97 @param This Protocol instance pointer.
98 @param Key A pointer to a buffer that is filled in with the keystroke
99 information for the key that was pressed.
100
101 @retval EFI_SUCCESS The keystroke information was returned.
102 @retval EFI_NOT_READY There was no keystroke data available.
103 @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
104 hardware errors.
105 @retval EFI_UNSUPPORTED The device does not support the ability to read keystroke data.
106
107**/
108typedef
112 OUT EFI_INPUT_KEY *Key
113 );
114
115///
116/// The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.
117/// It is the minimum required protocol for ConsoleIn.
118///
122 ///
123 /// Event to use with WaitForEvent() to wait for a key to be available
124 ///
126};
127
unsigned short UINT16
2-byte unsigned value.
unsigned char BOOLEAN
Logical Boolean.
unsigned short CHAR16
2-byte Character.
#define EFIAPI
EFI_STATUS(EFIAPI * EFI_INPUT_READ_KEY)(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, OUT EFI_INPUT_KEY *Key)
Reads the next keystroke from the input device.
struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL SIMPLE_INPUT_INTERFACE
Protocol name in EFI1.1 for backward-compatible.
EFI_GUID gEfiSimpleTextInProtocolGuid
struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL
EFI_STATUS(EFIAPI * EFI_INPUT_RESET)(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
Reset the input device and optionally run diagnostics.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
#define EFI_EVENT
Definition efi.h:54
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29
The keystroke information for the key that was pressed.
CHAR16 UnicodeChar
The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.
EFI_INPUT_READ_KEY ReadKeyStroke
EFI_EVENT WaitForKey
Event to use with WaitForEvent() to wait for a key to be available.