OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcTypingLib.h File Reference
#include <Uefi.h>
#include <Protocol/AppleEvent.h>
#include <Library/DebugLib.h>

Go to the source code of this file.

Macros

#define OC_TRACE_TYPING   DEBUG_VERBOSE
 
#define OC_TYPING_BUFFER_SIZE   21
 

Typedefs

struct { 
 
   APPLE_KEY_CODE   AppleKeyCode 
 
   CHAR16   UnicodeChar 
 
OC_TYPING_BUFFER_ENTRY 
 
struct { 
 
   OC_TYPING_BUFFER_ENTRY   Buffer [OC_TYPING_BUFFER_SIZE
 
   APPLE_MODIFIER_MAP   CurrentModifiers 
 
   UINT16   Pad1 
 
   APPLE_EVENT_HANDLE   Handle 
 
   UINTN   Head 
 
   UINTN   Tail 
 
   UINT64 *   KeyTimes 
 
OC_TYPING_CONTEXT 
 

Functions

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)
 

Detailed Description

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

Definition in file OcTypingLib.h.

Macro Definition Documentation

◆ OC_TRACE_TYPING

#define OC_TRACE_TYPING   DEBUG_VERBOSE

Definition at line 14 of file OcTypingLib.h.

◆ OC_TYPING_BUFFER_SIZE

#define OC_TYPING_BUFFER_SIZE   21

Definition at line 32 of file OcTypingLib.h.

Typedef Documentation

◆ [struct]

typedef PACKED struct { ... } OC_TYPING_BUFFER_ENTRY

◆ [struct]

typedef PACKED struct { ... } OC_TYPING_CONTEXT

Function Documentation

◆ 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

◆ AppleKeyCode

APPLE_KEY_CODE AppleKeyCode

Definition at line 37 of file OcTypingLib.h.

◆ Buffer

Definition at line 42 of file OcTypingLib.h.

◆ CurrentModifiers

APPLE_MODIFIER_MAP CurrentModifiers

Definition at line 43 of file OcTypingLib.h.

◆ Handle

Definition at line 45 of file OcTypingLib.h.

◆ Head

UINTN Head

Definition at line 46 of file OcTypingLib.h.

◆ KeyTimes

UINT64* KeyTimes

Definition at line 48 of file OcTypingLib.h.

◆ Pad1

UINT16 Pad1

Definition at line 44 of file OcTypingLib.h.

◆ Tail

UINTN Tail

Definition at line 47 of file OcTypingLib.h.

◆ UnicodeChar

CHAR16 UnicodeChar

Definition at line 38 of file OcTypingLib.h.