OpenCore
1.0.4
OpenCore Bootloader
|
#include <AppleMacEfi.h>
#include <IndustryStandard/AppleHid.h>
#include <Protocol/AppleKeyMapAggregator.h>
#include <Protocol/AppleKeyMapDatabase.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcAppleKeyMapLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcTimerLib.h>
#include <Library/TimerLib.h>
#include <Library/UefiBootServicesTableLib.h>
Go to the source code of this file.
Data Structures | |
struct | KEY_MAP_AGGREGATOR_DATA |
struct | APPLE_KEY_STROKES_INFO |
Macros | |
#define | KEY_MAP_AGGREGATOR_DATA_SIGNATURE SIGNATURE_32 ('K', 'e', 'y', 'A') |
#define | KEY_MAP_AGGREGATOR_DATA_FROM_AGGREGATOR_THIS(This) |
#define | KEY_MAP_AGGREGATOR_DATA_FROM_DATABASE_THIS(This) |
#define | APPLE_KEY_STROKES_INFO_SIGNATURE SIGNATURE_32 ('K', 'e', 'y', 'S') |
#define | APPLE_KEY_STROKES_INFO_FROM_LIST_ENTRY(Entry) |
#define | SIZE_OF_APPLE_KEY_STROKES_INFO OFFSET_OF (APPLE_KEY_STROKES_INFO, KeyCodes) |
Functions | |
STATIC APPLE_KEY_STROKES_INFO * | InternalGetKeyStrokesByIndex (IN KEY_MAP_AGGREGATOR_DATA *KeyMapAggregatorData, IN UINTN Index) |
STATIC EFI_STATUS EFIAPI | InternalGetKeyStrokes (IN APPLE_KEY_MAP_AGGREGATOR_PROTOCOL *This, OUT APPLE_MODIFIER_MAP *Modifiers, IN OUT UINTN *NumberOfKeyCodes, OUT APPLE_KEY_CODE *KeyCodes OPTIONAL) |
BOOLEAN | OcKeyMapHasKeys (IN CONST APPLE_KEY_CODE *Keys, IN UINTN NumKeys, IN CONST APPLE_KEY_CODE *CheckKeys, IN UINTN NumCheckKeys, IN BOOLEAN ExactMatch) |
BOOLEAN | OcKeyMapHasKey (IN CONST APPLE_KEY_CODE *Keys, IN UINTN NumKeys, IN CONST APPLE_KEY_CODE KeyCode) |
VOID | OcKeyMapFlush (IN APPLE_KEY_MAP_AGGREGATOR_PROTOCOL *KeyMap, IN APPLE_KEY_CODE Key, IN BOOLEAN FlushConsole) |
STATIC EFI_STATUS EFIAPI | InternalContainsKeyStrokes (IN APPLE_KEY_MAP_AGGREGATOR_PROTOCOL *This, IN APPLE_MODIFIER_MAP Modifiers, IN UINTN NumberOfKeyCodes, IN OUT APPLE_KEY_CODE *KeyCodes, IN BOOLEAN ExactMatch) |
STATIC EFI_STATUS EFIAPI | InternalCreateKeyStrokesBuffer (IN APPLE_KEY_MAP_DATABASE_PROTOCOL *This, IN UINTN BufferLength, OUT UINTN *Index) |
STATIC EFI_STATUS EFIAPI | InternalRemoveKeyStrokesBuffer (IN APPLE_KEY_MAP_DATABASE_PROTOCOL *This, IN UINTN Index) |
STATIC EFI_STATUS EFIAPI | InternalSetKeyStrokeBufferKeys (IN APPLE_KEY_MAP_DATABASE_PROTOCOL *This, IN UINTN Index, IN APPLE_MODIFIER_MAP Modifiers, IN UINTN NumberOfKeyCodes, IN APPLE_KEY_CODE *KeyCodes) |
APPLE_KEY_MAP_DATABASE_PROTOCOL * | OcAppleKeyMapGetDatabase (VOID) |
APPLE_KEY_MAP_AGGREGATOR_PROTOCOL * | OcAppleKeyMapInstallProtocols (IN BOOLEAN Reinstall) |
Variables | |
STATIC APPLE_KEY_MAP_DATABASE_PROTOCOL * | mKeyMapDatabase = NULL |
AppleKeyMapAggregator
Copyright (c) 2018, vit9696
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.
Definition in file OcAppleKeyMapLib.c.
#define APPLE_KEY_STROKES_INFO_FROM_LIST_ENTRY | ( | Entry | ) |
Definition at line 70 of file OcAppleKeyMapLib.c.
#define APPLE_KEY_STROKES_INFO_SIGNATURE SIGNATURE_32 ('K', 'e', 'y', 'S') |
Definition at line 67 of file OcAppleKeyMapLib.c.
#define KEY_MAP_AGGREGATOR_DATA_FROM_AGGREGATOR_THIS | ( | This | ) |
Definition at line 38 of file OcAppleKeyMapLib.c.
#define KEY_MAP_AGGREGATOR_DATA_FROM_DATABASE_THIS | ( | This | ) |
Definition at line 47 of file OcAppleKeyMapLib.c.
#define KEY_MAP_AGGREGATOR_DATA_SIGNATURE SIGNATURE_32 ('K', 'e', 'y', 'A') |
Definition at line 34 of file OcAppleKeyMapLib.c.
#define SIZE_OF_APPLE_KEY_STROKES_INFO OFFSET_OF (APPLE_KEY_STROKES_INFO, KeyCodes) |
Definition at line 78 of file OcAppleKeyMapLib.c.
STATIC EFI_STATUS EFIAPI InternalContainsKeyStrokes | ( | IN APPLE_KEY_MAP_AGGREGATOR_PROTOCOL * | This, |
IN APPLE_MODIFIER_MAP | Modifiers, | ||
IN UINTN | NumberOfKeyCodes, | ||
IN OUT APPLE_KEY_CODE * | KeyCodes, | ||
IN BOOLEAN | ExactMatch ) |
Returns whether or not a list of keys and their modifiers are part of the database of pressed keys.
[in] | This | A pointer to the protocol instance. |
[in] | Modifiers | The modifiers manipulating the given keys. |
[in] | NumberOfKeyCodes | The number of keys present in KeyCodes. |
[in,out] | KeyCodes | The list of keys to check for. The children may be sorted in the process. |
[in] | ExactMatch | Specifies whether Modifiers and KeyCodes should be exact matches or just contained. |
EFI_SUCCESS | The queried keys are part of the database. |
EFI_NOT_FOUND | The queried keys could not be found. |
Definition at line 332 of file OcAppleKeyMapLib.c.
STATIC EFI_STATUS EFIAPI InternalCreateKeyStrokesBuffer | ( | IN APPLE_KEY_MAP_DATABASE_PROTOCOL * | This, |
IN UINTN | BufferLength, | ||
OUT UINTN * | Index ) |
Creates a new key set with a given number of keys allocated. The index within the database is returned.
[in] | This | A pointer to the protocol instance. |
[in] | BufferLength | The amount of keys to allocate for the key set. |
[out] | Index | The assigned index of the created key set. |
EFI_SUCCESS | A key set with the given number of keys allocated has been created. |
EFI_OUT_OF_RESOURCES | The memory necessary to complete the operation could not be allocated. |
other | An error returned by a sub-operation. |
Definition at line 400 of file OcAppleKeyMapLib.c.
STATIC EFI_STATUS EFIAPI InternalGetKeyStrokes | ( | IN APPLE_KEY_MAP_AGGREGATOR_PROTOCOL * | This, |
OUT APPLE_MODIFIER_MAP * | Modifiers, | ||
IN OUT UINTN * | NumberOfKeyCodes, | ||
OUT APPLE_KEY_CODE *KeyCodes | OPTIONAL ) |
Returns all pressed keys and key modifiers into the appropiate buffers.
[in] | This | A pointer to the protocol instance. |
[out] | Modifiers | The modifiers manipulating the given keys. |
[in,out] | NumberOfKeyCodes | On input the number of keys allocated. On output the number of keys returned into KeyCodes. |
[out] | KeyCodes | A Pointer to a caller-allocated buffer in which the pressed keys get returned. |
EFI_SUCCESS | The pressed keys have been returned into KeyCodes. |
EFI_BUFFER_TOO_SMALL | The memory required to return the value exceeds the size of the allocated Buffer. The required number of keys to allocate to complete the operation has been returned into NumberOfKeyCodes. |
other | An error returned by a sub-operation. |
Definition at line 149 of file OcAppleKeyMapLib.c.
STATIC APPLE_KEY_STROKES_INFO * InternalGetKeyStrokesByIndex | ( | IN KEY_MAP_AGGREGATOR_DATA * | KeyMapAggregatorData, |
IN UINTN | Index ) |
Definition at line 95 of file OcAppleKeyMapLib.c.
STATIC EFI_STATUS EFIAPI InternalRemoveKeyStrokesBuffer | ( | IN APPLE_KEY_MAP_DATABASE_PROTOCOL * | This, |
IN UINTN | Index ) |
Removes a key set specified by its index from the database.
[in] | This | A pointer to the protocol instance. |
[in] | Index | The index of the key set to remove. |
EFI_SUCCESS | The specified key set has been removed. |
EFI_NOT_FOUND | No key set could be found for the given index. |
other | An error returned by a sub-operation. |
Definition at line 471 of file OcAppleKeyMapLib.c.
STATIC EFI_STATUS EFIAPI InternalSetKeyStrokeBufferKeys | ( | IN APPLE_KEY_MAP_DATABASE_PROTOCOL * | This, |
IN UINTN | Index, | ||
IN APPLE_MODIFIER_MAP | Modifiers, | ||
IN UINTN | NumberOfKeyCodes, | ||
IN APPLE_KEY_CODE * | KeyCodes ) |
Sets the keys of a key set specified by its index to the given KeyCodes Buffer.
[in] | This | A pointer to the protocol instance. |
[in] | Index | The index of the key set to edit. |
[in] | Modifiers | The key modifiers manipulating the given keys. |
[in] | NumberOfKeyCodes | The number of keys contained in KeyCodes. |
[in] | KeyCodes | An array of keys to add to the specified key set. |
EFI_SUCCESS | The given keys were set for the specified key set. |
EFI_OUT_OF_RESOURCES | The memory necessary to complete the operation could not be allocated. |
EFI_NOT_FOUND | No key set could be found for the given index. |
other | An error returned by a sub-operation. |
Definition at line 525 of file OcAppleKeyMapLib.c.
APPLE_KEY_MAP_DATABASE_PROTOCOL * OcAppleKeyMapGetDatabase | ( | VOID | ) |
Returns the previously install Apple Key Map Database protocol.
installed | or located protocol or NULL |
Definition at line 575 of file OcAppleKeyMapLib.c.
APPLE_KEY_MAP_AGGREGATOR_PROTOCOL * OcAppleKeyMapInstallProtocols | ( | IN BOOLEAN | Reinstall | ) |
Install and initialise Apple Key Map protocols.
[in] | Reinstall | Overwrite installed protocols. |
installed | or located protocol or NULL |
Definition at line 590 of file OcAppleKeyMapLib.c.
VOID OcKeyMapFlush | ( | IN APPLE_KEY_MAP_AGGREGATOR_PROTOCOL * | KeyMap, |
IN APPLE_KEY_CODE | Key, | ||
IN BOOLEAN | FlushConsole ) |
Performs keyboard input flush.
[in] | KeyMap | Apple Key Map Aggregator protocol. |
[in] | Key | Key to wait for removal or 0. |
[in] | FlushConsole | Also flush console input. |
Definition at line 264 of file OcAppleKeyMapLib.c.
BOOLEAN OcKeyMapHasKey | ( | IN CONST APPLE_KEY_CODE * | Keys, |
IN UINTN | NumKeys, | ||
IN CONST APPLE_KEY_CODE | KeyCode ) |
Checks whether or not a KeyCode is contained within Keys.
[in] | Keys | The reference keys. |
[in] | NumKeys | The number of keys in Keys. |
[in] | KeyCode | The key to locate in Keys. |
Definition at line 254 of file OcAppleKeyMapLib.c.
BOOLEAN OcKeyMapHasKeys | ( | IN CONST APPLE_KEY_CODE * | Keys, |
IN UINTN | NumKeys, | ||
IN CONST APPLE_KEY_CODE * | CheckKeys, | ||
IN UINTN | NumCheckKeys, | ||
IN BOOLEAN | ExactMatch ) |
Checks whether or not a list of keys is contained within another.
[in] | Keys | The reference keys. |
[in] | NumKeys | The number of keys in Keys. |
[in] | CheckKeys | The keys to locate in Keys. |
[in] | NumCheckKeys | The number of keys in CheckKeys. |
[in] | ExactMatch | Specifies whether matches must be exact. |
Definition at line 223 of file OcAppleKeyMapLib.c.
STATIC APPLE_KEY_MAP_DATABASE_PROTOCOL* mKeyMapDatabase = NULL |
Definition at line 567 of file OcAppleKeyMapLib.c.