2008-04-09 07:38:12 +02:00
|
|
|
/** @file
|
|
|
|
Provides a way for 3rd party applications to register themselves for launch by the
|
|
|
|
Boot Manager based on hot key
|
2008-01-21 15:39:56 +01:00
|
|
|
|
2008-04-09 07:38:12 +02:00
|
|
|
Copyright (c) 2007 - 2008, Intel Corporation. <BR>
|
2008-01-21 15:39:56 +01:00
|
|
|
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
|
|
|
|
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.
|
|
|
|
|
2008-04-09 07:38:12 +02:00
|
|
|
**/
|
2008-01-21 15:39:56 +01:00
|
|
|
|
2008-07-14 03:16:02 +02:00
|
|
|
#ifndef _HOTKEY_H_
|
|
|
|
#define _HOTKEY_H_
|
2008-01-21 15:39:56 +01:00
|
|
|
|
|
|
|
#include "Bds.h"
|
|
|
|
#include "String.h"
|
|
|
|
|
|
|
|
#define GET_KEY_CODE_COUNT(KeyOptions) (((KeyOptions) & EFI_KEY_CODE_COUNT) >> 8)
|
|
|
|
|
2008-12-16 16:34:21 +01:00
|
|
|
#define BDS_HOTKEY_OPTION_SIGNATURE SIGNATURE_32 ('B', 'd', 'K', 'O')
|
2008-01-21 15:39:56 +01:00
|
|
|
typedef struct {
|
|
|
|
UINTN Signature;
|
|
|
|
LIST_ENTRY Link;
|
|
|
|
|
|
|
|
EFI_HANDLE NotifyHandle;
|
|
|
|
UINT16 BootOptionNumber;
|
|
|
|
UINT8 CodeCount;
|
|
|
|
UINT8 WaitingKey;
|
|
|
|
EFI_KEY_DATA KeyData[3];
|
|
|
|
} BDS_HOTKEY_OPTION;
|
|
|
|
|
|
|
|
#define BDS_HOTKEY_OPTION_FROM_LINK(a) CR (a, BDS_HOTKEY_OPTION, Link, BDS_HOTKEY_OPTION_SIGNATURE)
|
|
|
|
|
2008-07-14 03:16:02 +02:00
|
|
|
#define VAR_KEY_ORDER L"KeyOrder"
|
2008-01-21 15:39:56 +01:00
|
|
|
|
2008-07-04 10:04:10 +02:00
|
|
|
/**
|
|
|
|
|
|
|
|
Create Key#### for the given hotkey.
|
|
|
|
|
|
|
|
|
|
|
|
@param KeyOption - The Hot Key Option to be added.
|
|
|
|
@param KeyOptionNumber - The key option number for Key#### (optional).
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Register hotkey successfully.
|
|
|
|
@retval EFI_INVALID_PARAMETER The hotkey option is invalid.
|
|
|
|
|
|
|
|
**/
|
2008-01-21 15:39:56 +01:00
|
|
|
EFI_STATUS
|
|
|
|
RegisterHotkey (
|
|
|
|
IN EFI_KEY_OPTION *KeyOption,
|
|
|
|
OUT UINT16 *KeyOptionNumber
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2008-01-21 15:39:56 +01:00
|
|
|
|
2008-07-04 10:04:10 +02:00
|
|
|
/**
|
2008-01-21 15:39:56 +01:00
|
|
|
|
2008-07-04 10:04:10 +02:00
|
|
|
Delete Key#### for the given Key Option number.
|
2008-01-21 15:39:56 +01:00
|
|
|
|
|
|
|
|
2008-07-04 10:04:10 +02:00
|
|
|
@param KeyOptionNumber - Key option number for Key####
|
2008-01-21 15:39:56 +01:00
|
|
|
|
2008-07-04 10:04:10 +02:00
|
|
|
@retval EFI_SUCCESS Unregister hotkey successfully.
|
|
|
|
@retval EFI_NOT_FOUND No Key#### is found for the given Key Option number.
|
2008-01-21 15:39:56 +01:00
|
|
|
|
2008-07-04 10:04:10 +02:00
|
|
|
**/
|
2008-01-21 15:39:56 +01:00
|
|
|
EFI_STATUS
|
|
|
|
UnregisterHotkey (
|
|
|
|
IN UINT16 KeyOptionNumber
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2008-01-21 15:39:56 +01:00
|
|
|
|
|
|
|
|
2008-07-04 10:04:10 +02:00
|
|
|
/**
|
2008-01-21 15:39:56 +01:00
|
|
|
|
2008-07-04 10:04:10 +02:00
|
|
|
Process all the "Key####" variables, associate Hotkeys with corresponding Boot Options.
|
2008-01-21 15:39:56 +01:00
|
|
|
|
|
|
|
|
2008-07-04 10:04:10 +02:00
|
|
|
@param VOID
|
2008-01-21 15:39:56 +01:00
|
|
|
|
2008-07-04 10:04:10 +02:00
|
|
|
@retval EFI_SUCCESS Hotkey services successfully initialized.
|
2008-01-21 15:39:56 +01:00
|
|
|
|
2008-07-04 10:04:10 +02:00
|
|
|
**/
|
2008-01-21 15:39:56 +01:00
|
|
|
EFI_STATUS
|
|
|
|
InitializeHotkeyService (
|
|
|
|
VOID
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2008-01-21 15:39:56 +01:00
|
|
|
|
|
|
|
#endif
|