OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcTypingLib.c File Reference
#include <Uefi.h>
#include <Library/BaseLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/OcAppleEventLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcTimerLib.h>
#include <Library/OcTypingLib.h>

Go to the source code of this file.

Functions

STATIC VOID EFIAPI HandleKeyEvent (IN APPLE_EVENT_INFORMATION *Information, IN OC_TYPING_CONTEXT *Context)
 
EFI_STATUS OcRegisterTypingHandler (OUT OC_TYPING_CONTEXT **Context)
 
EFI_STATUS OcUnregisterTypingHandler (IN OC_TYPING_CONTEXT **Context)
 
VOID OcGetNextKeystroke (IN OC_TYPING_CONTEXT *Context, OUT APPLE_MODIFIER_MAP *Modifiers, OUT APPLE_KEY_CODE *AppleKeyCode, OUT CHAR16 *UnicodeChar)
 
VOID OcFlushTypingBuffer (IN OC_TYPING_CONTEXT *Context)
 

Variables

STATIC APPLE_EVENT_PROTOCOLmProtocol
 

Detailed Description

Apple Event typing.

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

Definition in file OcTypingLib.c.

Function Documentation

◆ HandleKeyEvent()

STATIC VOID EFIAPI HandleKeyEvent ( IN APPLE_EVENT_INFORMATION * Information,
IN OC_TYPING_CONTEXT * Context )

Definition at line 23 of file OcTypingLib.c.

◆ OcFlushTypingBuffer()

VOID OcFlushTypingBuffer ( IN OC_TYPING_CONTEXT * Context)

Flush typing buffer.

Parameters
[in]ContextTyping handler context.

Definition at line 280 of file OcTypingLib.c.

◆ OcGetNextKeystroke()

VOID OcGetNextKeystroke ( IN OC_TYPING_CONTEXT * Context,
OUT APPLE_MODIFIER_MAP * Modifiers,
OUT APPLE_KEY_CODE * AppleKeyCode,
OUT CHAR16 * UnicodeChar )

Get next keystroke from typing buffer. Will always return immediately.

Parameters
[in]ContextTyping handler context.
[out]ModifiersCurrent key modifiers, returned even if no key is available.
[out]AppleKeyCodeNext keycode if one is available, zero otherwsie.
[out]UnicodeCharNext unicode char if one is available, L'\0' otherwsie.

Definition at line 223 of file OcTypingLib.c.

◆ OcRegisterTypingHandler()

EFI_STATUS OcRegisterTypingHandler ( OUT OC_TYPING_CONTEXT ** Context)

Register typing handler with Apple Event protocol.

Parameters
[out]ContextTyping handler context.
Return values
EFI_SUCCESSRegistered successfully.
EFI_OUT_OF_RESOURCESCould not allocate buffer memory.
otherAn error returned by a sub-operation.

Definition at line 91 of file OcTypingLib.c.

◆ OcUnregisterTypingHandler()

EFI_STATUS OcUnregisterTypingHandler ( IN OC_TYPING_CONTEXT ** Context)

Unregister typing handler.

Parameters
[in]ContextTyping handler context.
Return values
EFI_SUCCESSUnregistered successfully, or context was already null.
EFI_NOT_STARTEDNull Apple Event handle present in context.
otherAn error returned by a sub-operation.

Definition at line 173 of file OcTypingLib.c.

Variable Documentation

◆ mProtocol

STATIC APPLE_EVENT_PROTOCOL* mProtocol

Definition at line 18 of file OcTypingLib.c.