2007-06-19 12:12:02 +02:00
|
|
|
/** @file
|
2009-06-04 11:22:50 +02:00
|
|
|
Simple Text Input protocol from the UEFI 2.0 specification.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
Abstraction of a very simple input device like a keyboard or serial
|
|
|
|
terminal.
|
|
|
|
|
2011-05-04 03:06:43 +02:00
|
|
|
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
2010-10-25 00:03:38 +02:00
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2010-10-25 00:03:38 +02:00
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__
|
|
|
|
#define __SIMPLE_TEXT_IN_PROTOCOL_H__
|
|
|
|
|
2007-06-21 09:16:27 +02:00
|
|
|
#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
|
2007-06-19 12:12:02 +02:00
|
|
|
{ \
|
|
|
|
0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
|
|
|
|
}
|
|
|
|
|
2008-12-09 15:04:41 +01:00
|
|
|
typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
|
|
|
|
|
2008-08-14 06:29:48 +02:00
|
|
|
///
|
2008-12-09 15:04:41 +01:00
|
|
|
/// Protocol GUID name defined in EFI1.1.
|
2010-10-25 00:03:38 +02:00
|
|
|
///
|
2007-06-21 09:16:27 +02:00
|
|
|
#define SIMPLE_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2008-08-14 06:29:48 +02:00
|
|
|
///
|
2008-12-09 15:04:41 +01:00
|
|
|
/// Protocol name in EFI1.1 for backward-compatible.
|
2010-10-25 00:03:38 +02:00
|
|
|
///
|
2007-06-21 09:16:27 +02:00
|
|
|
typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL SIMPLE_INPUT_INTERFACE;
|
2008-12-09 15:04:41 +01:00
|
|
|
|
|
|
|
///
|
|
|
|
/// The keystroke information for the key that was pressed.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
typedef struct {
|
|
|
|
UINT16 ScanCode;
|
|
|
|
CHAR16 UnicodeChar;
|
|
|
|
} EFI_INPUT_KEY;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Required unicode control chars
|
|
|
|
//
|
|
|
|
#define CHAR_BACKSPACE 0x0008
|
|
|
|
#define CHAR_TAB 0x0009
|
|
|
|
#define CHAR_LINEFEED 0x000A
|
|
|
|
#define CHAR_CARRIAGE_RETURN 0x000D
|
|
|
|
|
|
|
|
//
|
|
|
|
// EFI Scan codes
|
|
|
|
//
|
|
|
|
#define SCAN_NULL 0x0000
|
|
|
|
#define SCAN_UP 0x0001
|
|
|
|
#define SCAN_DOWN 0x0002
|
|
|
|
#define SCAN_RIGHT 0x0003
|
|
|
|
#define SCAN_LEFT 0x0004
|
|
|
|
#define SCAN_HOME 0x0005
|
|
|
|
#define SCAN_END 0x0006
|
|
|
|
#define SCAN_INSERT 0x0007
|
|
|
|
#define SCAN_DELETE 0x0008
|
|
|
|
#define SCAN_PAGE_UP 0x0009
|
|
|
|
#define SCAN_PAGE_DOWN 0x000A
|
|
|
|
#define SCAN_F1 0x000B
|
|
|
|
#define SCAN_F2 0x000C
|
|
|
|
#define SCAN_F3 0x000D
|
|
|
|
#define SCAN_F4 0x000E
|
|
|
|
#define SCAN_F5 0x000F
|
|
|
|
#define SCAN_F6 0x0010
|
|
|
|
#define SCAN_F7 0x0011
|
|
|
|
#define SCAN_F8 0x0012
|
|
|
|
#define SCAN_F9 0x0013
|
|
|
|
#define SCAN_F10 0x0014
|
|
|
|
#define SCAN_ESC 0x0017
|
|
|
|
|
|
|
|
/**
|
2008-12-17 10:37:01 +01:00
|
|
|
Reset the input device and optionally run diagnostics
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
@param This Protocol instance pointer.
|
|
|
|
@param ExtendedVerification Driver may perform diagnostics on reset.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The device was reset.
|
|
|
|
@retval EFI_DEVICE_ERROR The device is not functioning properly and could not be reset.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_INPUT_RESET)(
|
2007-06-21 09:16:27 +02:00
|
|
|
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
2007-06-19 12:12:02 +02:00
|
|
|
IN BOOLEAN ExtendedVerification
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
/**
|
2010-10-25 00:03:38 +02:00
|
|
|
Reads the next keystroke from the input device. The WaitForKey Event can
|
2008-12-17 10:37:01 +01:00
|
|
|
be used to test for existence of a keystroke via WaitForEvent () call.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2010-10-25 00:03:38 +02:00
|
|
|
@param This Protocol instance pointer.
|
|
|
|
@param Key A pointer to a buffer that is filled in with the keystroke
|
|
|
|
information for the key that was pressed.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The keystroke information was returned.
|
2008-12-17 10:37:01 +01:00
|
|
|
@retval EFI_NOT_READY There was no keystroke data available.
|
|
|
|
@retval EFI_DEVICE_ERROR The keystroke information was not returned due to
|
2007-06-19 12:12:02 +02:00
|
|
|
hardware errors.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_INPUT_READ_KEY)(
|
2007-06-21 09:16:27 +02:00
|
|
|
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
2007-06-19 12:12:02 +02:00
|
|
|
OUT EFI_INPUT_KEY *Key
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2008-10-13 04:54:29 +02:00
|
|
|
///
|
2010-10-25 00:03:38 +02:00
|
|
|
/// The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.
|
2008-10-13 04:54:29 +02:00
|
|
|
/// It is the minimum required protocol for ConsoleIn.
|
|
|
|
///
|
2007-06-21 09:16:27 +02:00
|
|
|
struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_INPUT_RESET Reset;
|
|
|
|
EFI_INPUT_READ_KEY ReadKeyStroke;
|
2008-10-09 21:17:35 +02:00
|
|
|
///
|
|
|
|
/// Event to use with WaitForEvent() to wait for a key to be available
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
EFI_EVENT WaitForKey;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiSimpleTextInProtocolGuid;
|
|
|
|
|
|
|
|
#endif
|