EFI SIMPLE TEXT INPUT PROTOCOL
From PhoenixWiki
This protocol is used to obtain input from the ConsoleIn device. The UEFI specification requires that the EFI_SIMPLE_TEXT_INPUT_PROTOCOL supports the same languages as the corresponding EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
Contents |
GUID
#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
{0x387477c1,0x69c7,0x11d2,\
0x8e,0x39,0x00,0xa0,0xc9,0x69,0x72,0x3b}
Protocol Interface Structure
#include EFI_PROTOCOL_CONSUMER(SimpleTextIn) extern EFI_GUID gEfiSimpleTextInProtocolGuid;
typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
EFI_INPUT_RESET Reset;
EFI_INPUT_READ_KEY ReadKeyStroke;
EFI_EVENT WaitForKey;
} EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
Parameters
| Parameter | Description |
|---|---|
| Reset | Reset the ConsoleIn device. |
| ReadKeyStroke | Returns the next input character. |
| WaitForKey | Event to use with WaitForEvent() to wait for a key to be available. |
Description
The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device. It is the minimum required protocol for ConsoleIn.
Reset()
Resets the input device hardware.
Prototype
typedef EFI_STATUS (EFIAPI *EFI_INPUT_RESET) ( IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification );
Parameters
| Parameter | Description |
|---|---|
| This | A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL instance. |
| ExtendedVerification | Indicates that the driver may perform a more exhaustive verification operation of the device during reset. |
Description
The Reset() function resets the input device hardware.
The implementation of Reset is required to clear the contents of any input queues resident in memory used for buffering keystroke data and put the input stream in a known empty state.
As part of initialization process, the firmware/device will make a quick but reasonable attempt to verify that the device is functioning. If the ExtendedVerification flag is TRUE the firmware may take an extended amount of time to verify the device is operating on reset. Otherwise the reset operation is to occur as quickly as possible.
The hardware verification process is not defined by this specification and is left up to the platform firmware or driver to implement.
Status Codes Returned
| Status Code | Description |
|---|---|
| EFI_SUCCESS | The device was reset. |
| EFI_DEVICE_ERROR | The device is not functioning correctly and could not be reset. |
ReadKeyStroke()
Reads the next keystroke from the input device.
Prototype
typedef EFI_STATUS (EFIAPI *EFI_INPUT_READ_KEY) ( IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, OUT EFI_INPUT_KEY *Key );
Parameters
| Parameter | Description |
|---|---|
| This | A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL instance. |
| Key | A pointer to a buffer that is filled in with the keystroke information for the key that was pressed. |
Description
The ReadKeyStroke() function reads the next keystroke from the input device. If there is no pending keystroke the function returns EFI_NOT_READY. If there is a pending keystroke, then ScanCode is the EFI scan code defined in Table 80. The UnicodeChar is the actual printable character or is zero if the key does not represent a printable character (control key, function key, etc.).
Status Codes Returned
| Status Code | Description |
|---|---|
| EFI_SUCCESS | The keystroke information was returned. |
| EFI_NOT_READY | There was no keystroke data available. |
| EFI_DEVICE_ERROR | The keystroke information was not returned due to hardware errors. |
Copyright (C) 2008 Phoenix Technologies Ltd. All Rights Reserved. Portions copyright (C) 2008 UEFI Forum, Inc.
