OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
UpDownDetection.c File Reference
#include <Uefi.h>
#include <Protocol/AppleKeyMapAggregator.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcAppleKeyMapLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcTimerLib.h>
#include <Library/TimerLib.h>

Go to the source code of this file.

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)
 

Detailed Description

AppleKeyMapAggregator edge detection

Copyright (c) 2021, Mike Beaton. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause

Definition in file UpDownDetection.c.

Function Documentation

◆ OcFreeKeyRepeatContext()

VOID OcFreeKeyRepeatContext ( OC_KEY_REPEAT_CONTEXT ** Context)

Free key repeat context.

Parameters
[in]ContextKey repeat context to free.

Definition at line 21 of file UpDownDetection.c.

◆ OcGetUpDownKeys()

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.

Parameters
[in,out]RepeatContextOn 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]ModifiersThe key modifiers currently applicable.
[in,out]NumKeysUpOn 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]KeysUpA Pointer to a optional caller-allocated buffer in which new up keycodes get returned.
[in,out]NumKeysDownOn 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]KeysDownA Pointer to an optional caller-allocated buffer in which new down keycodes get returned.
[in]CurrentTimeCurrent time (arbitrary units with sufficient resolution). Need not be valid on initial call only.
Return values
EFI_SUCCESSThe requested key transitions and states have been returned or updated as requested in the various out parameters.
EFI_UNSUPPORTEDUnsupported buffer/size combination.
otherAn error returned by a sub-operation.

Definition at line 126 of file UpDownDetection.c.

◆ OcInitKeyRepeatContext()

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.

Parameters
[out]ContextAllocated key repeat context structure is returned here.
[in]KeyMapThe key map aggregator protocol instance to use.
[in]MaxKeysHeldNumber of entries to allocate in held keys buffer.
[in]InitialDelayKey repeat initial delay. Same time units as CurrentTime passed to subsequent calls of OcGetUpDownKeys.
[in]SubsequentDelayKey repeat subsequent delay. Same time units as CurrentTime passed to subsequent calls of OcGetUpDownKeys.
[in]PreventInitialRepeatIf true, set up buffer so that keys held at init do not repeat until released and then pressed again.
Return values
EFI_SUCCESSThe repeat context has been initialised.
otherAn error returned by a sub-operation.

Definition at line 41 of file UpDownDetection.c.