Path: blob/main/sys/contrib/edk2/Include/Protocol/SimpleTextIn.h
48383 views
/** @file1Simple Text Input protocol from the UEFI 2.0 specification.23Abstraction of a very simple input device like a keyboard or serial4terminal.56Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>7SPDX-License-Identifier: BSD-2-Clause-Patent89**/1011#ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__12#define __SIMPLE_TEXT_IN_PROTOCOL_H__1314#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \15{ \160x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \17}1819typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;2021///22/// Protocol GUID name defined in EFI1.1.23///24#define SIMPLE_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID2526///27/// Protocol name in EFI1.1 for backward-compatible.28///29typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL SIMPLE_INPUT_INTERFACE;3031///32/// The keystroke information for the key that was pressed.33///34typedef struct {35UINT16 ScanCode;36CHAR16 UnicodeChar;37} EFI_INPUT_KEY;3839//40// Required unicode control chars41//42#define CHAR_BACKSPACE 0x000843#define CHAR_TAB 0x000944#define CHAR_LINEFEED 0x000A45#define CHAR_CARRIAGE_RETURN 0x000D4647//48// EFI Scan codes49//50#define SCAN_NULL 0x000051#define SCAN_UP 0x000152#define SCAN_DOWN 0x000253#define SCAN_RIGHT 0x000354#define SCAN_LEFT 0x000455#define SCAN_HOME 0x000556#define SCAN_END 0x000657#define SCAN_INSERT 0x000758#define SCAN_DELETE 0x000859#define SCAN_PAGE_UP 0x000960#define SCAN_PAGE_DOWN 0x000A61#define SCAN_F1 0x000B62#define SCAN_F2 0x000C63#define SCAN_F3 0x000D64#define SCAN_F4 0x000E65#define SCAN_F5 0x000F66#define SCAN_F6 0x001067#define SCAN_F7 0x001168#define SCAN_F8 0x001269#define SCAN_F9 0x001370#define SCAN_F10 0x001471#define SCAN_ESC 0x00177273/**74Reset the input device and optionally run diagnostics7576@param This Protocol instance pointer.77@param ExtendedVerification Driver may perform diagnostics on reset.7879@retval EFI_SUCCESS The device was reset.80@retval EFI_DEVICE_ERROR The device is not functioning properly and could not be reset.8182**/83typedef84EFI_STATUS85(EFIAPI *EFI_INPUT_RESET)(86IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,87IN BOOLEAN ExtendedVerification88);8990/**91Reads the next keystroke from the input device. The WaitForKey Event can92be used to test for existence of a keystroke via WaitForEvent () call.9394@param This Protocol instance pointer.95@param Key A pointer to a buffer that is filled in with the keystroke96information for the key that was pressed.9798@retval EFI_SUCCESS The keystroke information was returned.99@retval EFI_NOT_READY There was no keystroke data available.100@retval EFI_DEVICE_ERROR The keystroke information was not returned due to101hardware errors.102@retval EFI_UNSUPPORTED The device does not support the ability to read keystroke data.103104**/105typedef106EFI_STATUS107(EFIAPI *EFI_INPUT_READ_KEY)(108IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,109OUT EFI_INPUT_KEY *Key110);111112///113/// The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.114/// It is the minimum required protocol for ConsoleIn.115///116struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {117EFI_INPUT_RESET Reset;118EFI_INPUT_READ_KEY ReadKeyStroke;119///120/// Event to use with WaitForEvent() to wait for a key to be available121///122EFI_EVENT WaitForKey;123};124125extern EFI_GUID gEfiSimpleTextInProtocolGuid;126127#endif128129130