OpenCore
1.0.4
OpenCore Bootloader
|
#include <Protocol/AppleKeyMapDatabase.h>
#include <Protocol/AppleKeyMapAggregator.h>
#include <Library/DebugLib.h>
Go to the source code of this file.
Data Structures | |
struct | OC_KEY_REPEAT_CONTEXT |
Macros | |
#define | OC_TRACE_UPDOWNKEYS DEBUG_VERBOSE |
#define | OC_KEY_MAP_DEFAULT_SIZE 8 |
#define | OC_HELD_KEYS_DEFAULT_SIZE 8 |
#define | OC_DOWNKEYS_DEFAULT_INITIAL_DELAY 350 |
#define | OC_DOWNKEYS_DEFAULT_SUBSEQUENT_DELAY 80 |
Functions | |
VOID | OcFreeKeyRepeatContext (OC_KEY_REPEAT_CONTEXT **Context) |
EFI_STATUS | OcInitKeyRepeatContext (OUT OC_KEY_REPEAT_CONTEXT **Context, IN APPLE_KEY_MAP_AGGREGATOR_PROTOCOL *KeyMap, IN UINTN MaxKeysHeld, IN UINT64 InitialDelay, IN UINT64 SubsequentDelay, IN BOOLEAN PreventInitialRepeat) |
EFI_STATUS EFIAPI | OcGetUpDownKeys (IN OUT OC_KEY_REPEAT_CONTEXT *RepeatContext, OUT APPLE_MODIFIER_MAP *Modifiers, IN OUT UINTN *NumKeysUp, OUT APPLE_KEY_CODE *KeysUp OPTIONAL, IN OUT UINTN *NumKeysDown, OUT APPLE_KEY_CODE *KeysDown OPTIONAL, IN UINT64 CurrentTime) |
APPLE_KEY_MAP_DATABASE_PROTOCOL * | OcAppleKeyMapGetDatabase (VOID) |
APPLE_KEY_MAP_AGGREGATOR_PROTOCOL * | OcAppleKeyMapInstallProtocols (IN BOOLEAN Reinstall) |
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) |
Copyright (C) 2019, Download-Fritz. All rights reserved.
Copyright (C) 2021, Mike Beaton. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
Definition in file OcAppleKeyMapLib.h.
#define OC_DOWNKEYS_DEFAULT_INITIAL_DELAY 350 |
Default initial and subsequent key repeat delays in milliseconds.
Definition at line 31 of file OcAppleKeyMapLib.h.
#define OC_DOWNKEYS_DEFAULT_SUBSEQUENT_DELAY 80 |
Definition at line 32 of file OcAppleKeyMapLib.h.
#define OC_HELD_KEYS_DEFAULT_SIZE 8 |
Default buffer size for held keys in downkeys support.
Definition at line 26 of file OcAppleKeyMapLib.h.
#define OC_KEY_MAP_DEFAULT_SIZE 8 |
Default buffer size for key map.
Definition at line 21 of file OcAppleKeyMapLib.h.
#define OC_TRACE_UPDOWNKEYS DEBUG_VERBOSE |
Definition at line 15 of file OcAppleKeyMapLib.h.
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 OcFreeKeyRepeatContext | ( | OC_KEY_REPEAT_CONTEXT ** | Context | ) |
Free key repeat context.
[in] | Context | Key repeat context to free. |
Definition at line 21 of file UpDownDetection.c.
EFI_STATUS EFIAPI OcGetUpDownKeys | ( | IN OUT OC_KEY_REPEAT_CONTEXT * | RepeatContext, |
OUT APPLE_MODIFIER_MAP * | Modifiers, | ||
IN OUT UINTN * | NumKeysUp, | ||
OUT APPLE_KEY_CODE *KeysUp | OPTIONAL, | ||
IN OUT UINTN * | NumKeysDown, | ||
OUT APPLE_KEY_CODE *KeysDown | OPTIONAL, | ||
IN UINT64 | CurrentTime ) |
Returns all key transitions and key modifiers into the appropiate buffers.
[in,out] | RepeatContext | On input the previous (or newly initialised) repeat context. On output the newly updated key repeat context; values of interest to the caller are not intended to be read from the context, but from the other parameters above. |
[out] | Modifiers | The key modifiers currently applicable. |
[in,out] | NumKeysUp | On input the number of keys allocated for KeysUp. Ignored if KeysUp is null. On output the number of up keys detected, with their keycodes returned into KeysUp if present. |
[out] | KeysUp | A Pointer to a optional caller-allocated buffer in which new up keycodes get returned. |
[in,out] | NumKeysDown | On input with KeysDown non-null, the number of keys allocated for KeysDown and the total number of keys to check. On input and with KeysDown null, this parameter still represents the total number of keys to check. On output the number of down keys detected, with their keycodes returned into KeysDown if present. |
[out] | KeysDown | A Pointer to an optional caller-allocated buffer in which new down keycodes get returned. |
[in] | CurrentTime | Current time (arbitrary units with sufficient resolution). Need not be valid on initial call only. |
EFI_SUCCESS | The requested key transitions and states have been returned or updated as requested in the various out parameters. |
EFI_UNSUPPORTED | Unsupported buffer/size combination. |
other | An error returned by a sub-operation. |
Definition at line 126 of file UpDownDetection.c.
EFI_STATUS OcInitKeyRepeatContext | ( | OUT OC_KEY_REPEAT_CONTEXT ** | Context, |
IN APPLE_KEY_MAP_AGGREGATOR_PROTOCOL * | KeyMap, | ||
IN UINTN | MaxKeysHeld, | ||
IN UINT64 | InitialDelay, | ||
IN UINT64 | SubsequentDelay, | ||
IN BOOLEAN | PreventInitialRepeat ) |
Initialise key repeat context.
[out] | Context | Allocated key repeat context structure is returned here. |
[in] | KeyMap | The key map aggregator protocol instance to use. |
[in] | MaxKeysHeld | Number of entries to allocate in held keys buffer. |
[in] | InitialDelay | Key repeat initial delay. Same time units as CurrentTime passed to subsequent calls of OcGetUpDownKeys. |
[in] | SubsequentDelay | Key repeat subsequent delay. Same time units as CurrentTime passed to subsequent calls of OcGetUpDownKeys. |
[in] | PreventInitialRepeat | If true, set up buffer so that keys held at init do not repeat until released and then pressed again. |
EFI_SUCCESS | The repeat context has been initialised. |
other | An error returned by a sub-operation. |
Definition at line 41 of file UpDownDetection.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.