diff options
Diffstat (limited to 'src/include/ipxe/efi/Protocol/SimpleTextInEx.h')
-rw-r--r-- | src/include/ipxe/efi/Protocol/SimpleTextInEx.h | 161 |
1 files changed, 74 insertions, 87 deletions
diff --git a/src/include/ipxe/efi/Protocol/SimpleTextInEx.h b/src/include/ipxe/efi/Protocol/SimpleTextInEx.h index 9a9f5ab59..9a93da509 100644 --- a/src/include/ipxe/efi/Protocol/SimpleTextInEx.h +++ b/src/include/ipxe/efi/Protocol/SimpleTextInEx.h @@ -5,28 +5,21 @@ 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 - 2012, Intel Corporation. All rights reserved.<BR> - 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 - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ #ifndef __SIMPLE_TEXT_IN_EX_H__ #define __SIMPLE_TEXT_IN_EX_H__ -FILE_LICENCE ( BSD3 ); +FILE_LICENCE ( BSD2_PATENT ); #include <ipxe/efi/Protocol/SimpleTextIn.h> #define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ {0xdd9e7534, 0x7762, 0x4698, { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } } - typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; /** @@ -59,8 +52,7 @@ EFI_STATUS (EFIAPI *EFI_INPUT_RESET_EX)( IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN BOOLEAN ExtendedVerification -); - + ); /// /// EFI_KEY_TOGGLE_STATE. The toggle states are defined. @@ -76,25 +68,25 @@ typedef struct _EFI_KEY_STATE { /// returned value is valid only if the high /// order bit has been set. /// - UINT32 KeyShiftState; + 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_TOGGLE_STATE KeyToggleState; } EFI_KEY_STATE; typedef struct { /// /// The EFI scan code and Unicode value returned from the input device. /// - EFI_INPUT_KEY Key; + EFI_INPUT_KEY Key; /// /// The current state of various toggled attributes as well as input modifier values. /// - EFI_KEY_STATE KeyState; + EFI_KEY_STATE KeyState; } EFI_KEY_DATA; // @@ -103,55 +95,55 @@ typedef struct { // // 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 +#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_KEY_STATE_EXPOSED 0x40 -#define EFI_SCROLL_LOCK_ACTIVE 0x01 -#define EFI_NUM_LOCK_ACTIVE 0x02 -#define EFI_CAPS_LOCK_ACTIVE 0x04 +#define EFI_TOGGLE_STATE_VALID 0x80 +#define EFI_KEY_STATE_EXPOSED 0x40 +#define EFI_SCROLL_LOCK_ACTIVE 0x01 +#define EFI_NUM_LOCK_ACTIVE 0x02 +#define EFI_CAPS_LOCK_ACTIVE 0x04 // // EFI Scan codes // -#define SCAN_F11 0x0015 -#define SCAN_F12 0x0016 -#define SCAN_PAUSE 0x0048 -#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 +#define SCAN_F11 0x0015 +#define SCAN_F12 0x0016 +#define SCAN_PAUSE 0x0048 +#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 @@ -192,13 +184,10 @@ typedef struct { pressed. - @retval EFI_SUCCESS The keystroke information was - returned. - - @retval EFI_NOT_READY There was no keystroke data available. - EFI_DEVICE_ERROR The keystroke - information was not returned due to - hardware errors. + @retval EFI_SUCCESS The keystroke information was returned. + @retval EFI_NOT_READY There was no keystroke data available. + @retval EFI_DEVICE_ERROR The keystroke information was not returned due to + hardware errors. **/ @@ -207,7 +196,7 @@ EFI_STATUS (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 @@ -234,7 +223,7 @@ EFI_STATUS (EFIAPI *EFI_SET_STATE)( IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_TOGGLE_STATE *KeyToggleState -); + ); /// /// The function will be called when the key sequence is typed specified by KeyData. @@ -243,7 +232,7 @@ typedef EFI_STATUS (EFIAPI *EFI_KEY_NOTIFY_FUNCTION)( IN EFI_KEY_DATA *KeyData -); + ); /** The RegisterKeystrokeNotify() function registers a function @@ -253,18 +242,19 @@ EFI_STATUS @param KeyData A pointer to a buffer that is filled in with the keystroke information for the key that was - pressed. + pressed. If KeyData.Key, KeyData.KeyState.KeyToggleState + and KeyData.KeyState.KeyShiftState are 0, then any incomplete + keystroke will trigger a notification of the KeyNotificationFunction. - @param KeyNotificationFunction Points to the function to be - called when the key sequence - is typed specified by KeyData. + @param KeyNotificationFunction Points to the function to be called when the key sequence + is typed specified by KeyData. This notification function + should be called at <=TPL_CALLBACK. @param NotifyHandle Points to the unique handle assigned to the registered notification. - @retval EFI_SUCCESS The device state was set - appropriately. + @retval EFI_SUCCESS Key notify was registered successfully. @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary data structures. @@ -277,7 +267,7 @@ EFI_STATUS IN EFI_KEY_DATA *KeyData, IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, OUT VOID **NotifyHandle -); + ); /** The UnregisterKeystrokeNotify() function removes the @@ -288,7 +278,7 @@ EFI_STATUS @param NotificationHandle The handle of the notification function being unregistered. - @retval EFI_SUCCESS The device state was set appropriately. + @retval EFI_SUCCESS Key notify was unregistered successfully. @retval EFI_INVALID_PARAMETER The NotificationHandle is invalid. @@ -299,8 +289,7 @@ EFI_STATUS (EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)( IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN VOID *NotificationHandle -); - + ); /// /// The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL is used on the ConsoleIn @@ -308,20 +297,18 @@ EFI_STATUS /// 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; +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; - EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify; + EFI_EVENT WaitForKeyEx; + EFI_SET_STATE SetState; + EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify; + EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify; }; - -extern EFI_GUID gEfiSimpleTextInputExProtocolGuid; +extern EFI_GUID gEfiSimpleTextInputExProtocolGuid; #endif - |