X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FInclude%2FProtocol%2FSimpleTextInEx.h;h=5baede162ffb6d9810f337ba459a36e18c24e546;hp=3aa4ecca1a855ef95d48b320cc63e7a98eaadb91;hb=f754f721bf10508ca15c5c9243caa39c765662cf;hpb=d1f950002362305fcd4c30f108ef7b76679f5843 diff --git a/MdePkg/Include/Protocol/SimpleTextInEx.h b/MdePkg/Include/Protocol/SimpleTextInEx.h index 3aa4ecca1a..5baede162f 100644 --- a/MdePkg/Include/Protocol/SimpleTextInEx.h +++ b/MdePkg/Include/Protocol/SimpleTextInEx.h @@ -1,10 +1,11 @@ /** @file - The file defines the protocol to obtain input from the - ConsoleIn device. The EFI specification requires that the - EFI_SIMPLE_TEXT_INPUT_PROTOCOL supports the same languages as - the corresponding + Simple Text Input Ex protocol from the UEFI 2.0 specification. + + This protocol defines an extension to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL + which exposes much more state and modifier information from the input device, + also allows one to register a notification for a particular keystroke. - Copyright (c) 2006 - 2007, Intel Corporation + Copyright (c) 2006 - 2009, Intel Corporation All rights reserved. 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 @@ -13,8 +14,6 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - Module Name: SimpleTextInEx.h - **/ #ifndef __SIMPLE_TEXT_IN_EX_H__ @@ -37,9 +36,7 @@ typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTO this specification and is left up to the platform firmware or driver to implement. - @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX - instance. Type EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX - is defined in this section. + @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. @param ExtendedVerification Indicates that the driver may perform a more exhaustive @@ -47,7 +44,7 @@ typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTO device during reset. - @retval EFI_SUCCESS The device was reset. + @retval EFI_SUCCESS The device was reset. @retval EFI_DEVICE_ERROR The device is not functioning correctly and could not be reset. @@ -55,79 +52,105 @@ typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTO **/ typedef EFI_STATUS -(EFIAPI *EFI_INPUT_RESET_EX) ( - IN CONST EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, - IN CONST BOOLEAN ExtendedVerification +(EFIAPI *EFI_INPUT_RESET_EX)( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN BOOLEAN ExtendedVerification ); -// -// EFI_KEY_TOGGLE_STATE -// -typedef UINT8 EFI_KEY_TOGGLE_STATE; -#define TOGGLE_STATE_VALID 0x80 -#define SCROLL_LOCK_ACTIVE 0x01 -#define NUM_LOCK_ACTIVE 0x02 -#define CAPS_LOCK_ACTIVE 0x04 - -/** - Definition of EFI_KEY_STATE - - @param KeyShiftState Reflects the currently pressed shift - modifiers for the input device. The - returned value is valid only if the high - order bit has been set. - - @param KeyToggleState Reflects the current internal state of - various toggled attributes. The returned - value is valid only if the high order - bit has been set. +/// +/// EFI_KEY_TOGGLE_STATE. The toggle states are defined. +/// They are: EFI_TOGGLE_STATE_VALID, EFI_SCROLL_LOCK_ACTIVE +/// EFI_NUM_LOCK_ACTIVE, EFI_CAPS_LOCK_ACTIVE +/// +typedef UINT8 EFI_KEY_TOGGLE_STATE; -**/ typedef struct _EFI_KEY_STATE { + /// + /// Reflects the currently pressed shift + /// modifiers for the input device. The + /// returned value is valid only if the high + /// order bit has been set. + /// UINT32 KeyShiftState; + /// + /// Reflects the current internal state of + /// various toggled attributes. The returned + /// value is valid only if the high order + /// bit has been set. + /// EFI_KEY_TOGGLE_STATE KeyToggleState; } EFI_KEY_STATE; -/** - Definition of EFI_KEY_DATA. - - @param Key The EFI scan code and Unicode value returned from - the input device. - - @param KeyState The current state of various toggled - attributes as well as input modifier values. - -**/ typedef struct { + /// + /// The EFI scan code and Unicode value returned from the input device. + /// EFI_INPUT_KEY Key; + /// + /// The current state of various toggled attributes as well as input modifier values. + /// EFI_KEY_STATE KeyState; } EFI_KEY_DATA; -// -// Shift State. // // Any Shift or Toggle State that is valid should have // high order bit set. // -#define SHIFT_STATE_VALID 0x80000000 -#define RIGHT_SHIFT_PRESSED 0x00000001 -#define LEFT_SHIFT_PRESSED 0x00000002 -#define RIGHT_CONTROL_PRESSED 0x00000004 -#define LEFT_CONTROL_PRESSED 0x00000008 -#define RIGHT_ALT_PRESSED 0x00000010 -#define LEFT_ALT_PRESSED 0x00000020 -#define RIGHT_LOGO_PRESSED 0x00000040 -#define LEFT_LOGO_PRESSED 0x00000080 -#define MENU_KEY_PRESSED 0x00000100 -#define SYS_REQ_PRESSED 0x00000200 +// Shift state +// +#define EFI_SHIFT_STATE_VALID 0x80000000 +#define EFI_RIGHT_SHIFT_PRESSED 0x00000001 +#define EFI_LEFT_SHIFT_PRESSED 0x00000002 +#define EFI_RIGHT_CONTROL_PRESSED 0x00000004 +#define EFI_LEFT_CONTROL_PRESSED 0x00000008 +#define EFI_RIGHT_ALT_PRESSED 0x00000010 +#define EFI_LEFT_ALT_PRESSED 0x00000020 +#define EFI_RIGHT_LOGO_PRESSED 0x00000040 +#define EFI_LEFT_LOGO_PRESSED 0x00000080 +#define EFI_MENU_KEY_PRESSED 0x00000100 +#define EFI_SYS_REQ_PRESSED 0x00000200 + +// +// Toggle state +// +#define EFI_TOGGLE_STATE_VALID 0x80 +#define EFI_SCROLL_LOCK_ACTIVE 0x01 +#define EFI_NUM_LOCK_ACTIVE 0x02 +#define EFI_CAPS_LOCK_ACTIVE 0x04 + +// +// EFI Scan codes +// +#define SCAN_F13 0x0068 +#define SCAN_F14 0x0069 +#define SCAN_F15 0x006A +#define SCAN_F16 0x006B +#define SCAN_F17 0x006C +#define SCAN_F18 0x006D +#define SCAN_F19 0x006E +#define SCAN_F20 0x006F +#define SCAN_F21 0x0070 +#define SCAN_F22 0x0071 +#define SCAN_F23 0x0072 +#define SCAN_F24 0x0073 +#define SCAN_MUTE 0x007F +#define SCAN_VOLUME_UP 0x0080 +#define SCAN_VOLUME_DOWN 0x0081 +#define SCAN_BRIGHTNESS_UP 0x0100 +#define SCAN_BRIGHTNESS_DOWN 0x0101 +#define SCAN_SUSPEND 0x0102 +#define SCAN_HIBERNATE 0x0103 +#define SCAN_TOGGLE_DISPLAY 0x0104 +#define SCAN_RECOVERY 0x0105 +#define SCAN_EJECT 0x0106 /** The 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 KeyData.Key.ScanCode is the EFI scan code defined in Error! - Reference source not found.. The KeyData.Key.UnicodeChar is the + Reference source not found. The KeyData.Key.UnicodeChar is the actual printable character or is zero if the key does not represent a printable character (control key, function key, etc.). The KeyData.KeyState is shift state for the character @@ -154,8 +177,7 @@ typedef struct { respective Toggle and Shift state fields should not be active. - @param This A pointer to the - EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX instance. + @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. @param KeyData A pointer to a buffer that is filled in with the keystroke state data for the key that was @@ -174,24 +196,22 @@ typedef struct { **/ typedef EFI_STATUS -(EFIAPI *EFI_INPUT_READ_KEY_EX) ( - IN CONST EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, - OUT EFI_KEY_DATA *KeyData +(EFIAPI *EFI_INPUT_READ_KEY_EX)( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + OUT EFI_KEY_DATA *KeyData ); /** The SetState() function allows the input device hardware to have state settings adjusted. - @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX - instance. Type EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX - is defined in this section. + @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. @param KeyToggleState Pointer to the EFI_KEY_TOGGLE_STATE to set the state for the input device. - @retval EFI_SUCCESS The device state was set appropriately. + @retval EFI_SUCCESS The device state was set appropriately. @retval EFI_DEVICE_ERROR The device is not functioning correctly and could not have the @@ -203,39 +223,37 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SET_STATE) ( - IN CONST EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, - IN CONST EFI_KEY_TOGGLE_STATE *KeyToggleState +(EFIAPI *EFI_SET_STATE)( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_KEY_TOGGLE_STATE *KeyToggleState ); -// -// EFI_KEY_NOTIFY -// +/// +/// The function will be called when the key sequence is typed specified by KeyData. +/// typedef EFI_STATUS -(EFIAPI *EFI_KEY_NOTIFY_FUNCTION) ( - IN CONST EFI_KEY_DATA *KeyData +(EFIAPI *EFI_KEY_NOTIFY_FUNCTION)( + IN EFI_KEY_DATA *KeyData ); /** The RegisterKeystrokeNotify() function registers a function which will be called when a specified keystroke will occur. - @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX - instance. Type EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX - is defined in this section. + @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. - @param KeyData A pointer to a buffer that is filled in with - the keystroke information for the key that was - pressed. + @param KeyData A pointer to a buffer that is filled in with + the keystroke information for the key that was + pressed. @param KeyNotificationFunction Points to the function to be called when the key sequence is typed specified by KeyData. - @param NotifyHandle Points to the unique handle assigned to - the registered notification. + @param NotifyHandle Points to the unique handle assigned to + the registered notification. @retval EFI_SUCCESS The device state was set appropriately. @@ -246,19 +264,18 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) ( - IN CONST EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, - IN CONST EFI_KEY_DATA *KeyData, - IN CONST EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, - OUT EFI_HANDLE *NotifyHandle +(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY)( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_KEY_DATA *KeyData, + IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, + OUT EFI_HANDLE *NotifyHandle ); /** The UnregisterKeystrokeNotify() function removes the notification which was previously registered. - @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL_EX - instance. + @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. @param NotificationHandle The handle of the notification function being unregistered. @@ -271,40 +288,24 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) ( -IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, -IN EFI_HANDLE NotificationHandle +(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)( + IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_HANDLE NotificationHandle ); -/** - The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL is used on the ConsoleIn - device. It is an extension to the Simple Text Input protocol - which allows a variety of extended shift state information to be - returned. - - @param Reset Reset the ConsoleIn device. See Reset(). - - @param ReadKeyStrokeEx Returns the next input character. See - ReadKeyStrokeEx(). - - @param WaitForKeyEx Event to use with WaitForEvent() to wait - for a key to be available. - - @param SetState Set the EFI_KEY_TOGGLE_STATE state settings - for the input device. - - @param RegisterKeyNotify Register a notification function to - be called when a given key sequence - is hit. - - @param UnregisterKeyNotifyRemoves A specific notification - function. - -**/ +/// +/// The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL is used on the ConsoleIn +/// device. It is an extension to the Simple Text Input protocol +/// which allows a variety of extended shift state information to be +/// returned. +/// struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL{ EFI_INPUT_RESET_EX Reset; EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx; + /// + /// Event to use with WaitForEvent() to wait for a key to be available. + /// EFI_EVENT WaitForKeyEx; EFI_SET_STATE SetState; EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify;