OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
KeyHandler.c File Reference
#include <AppleMacEfi.h>
#include <IndustryStandard/AppleHid.h>
#include <Protocol/AppleKeyMapAggregator.h>
#include <Protocol/ConsoleControl.h>
#include <Library/AppleEventLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include "AppleEventInternal.h"

Go to the source code of this file.

Data Structures

struct  KEY_STROKE_INFORMATION
 

Macros

#define KEY_STROKE_DELAY   5
 
#define KEY_STROKE_POLL_FREQUENCY   EFI_TIMER_PERIOD_MILLISECONDS (10)
 

Functions

VOID InternalSetKeyBehaviour (IN BOOLEAN CustomDelays, IN UINT16 KeyInitialDelay, IN UINT16 KeySubsequentDelay, IN BOOLEAN GraphicsInputMirroring)
 
STATIC EFI_STATUS InternalGetAppleKeyStrokes (OUT APPLE_MODIFIER_MAP *Modifiers, OUT UINTN *NumberOfKeyCodes, OUT APPLE_KEY_CODE **KeyCodes)
 
APPLE_MODIFIER_MAP InternalGetModifierStrokes (VOID)
 
STATIC EFI_STATUS InternalAppleKeyEventDataFromInputKey (OUT APPLE_EVENT_DATA *EventData, IN APPLE_KEY_CODE *AppleKeyCode, IN EFI_INPUT_KEY *InputKey)
 
STATIC UINTN InternalGetAndRemoveReleasedKeys (IN CONST UINTN *NumberOfKeyCodes, IN CONST APPLE_KEY_CODE *KeyCodes, OUT APPLE_KEY_CODE **ReleasedKeys)
 
STATIC BOOLEAN InternalIsCLockOn (IN CONST UINTN *NumberOfKeyCodes, IN CONST APPLE_KEY_CODE *KeyCodes)
 
STATIC KEY_STROKE_INFORMATIONInternalGetCurrentStroke (VOID)
 
STATIC EFI_STATUS InternalGetCurrentKeyStroke (IN APPLE_MODIFIER_MAP Modifiers, IN OUT UINTN *NumberOfKeyCodes, IN OUT APPLE_KEY_CODE *KeyCodes, IN OUT EFI_INPUT_KEY *Key)
 
STATIC EFI_STATUS InternalAppleEventDataFromCurrentKeyStroke (IN OUT APPLE_EVENT_DATA *EventData, IN OUT APPLE_MODIFIER_MAP *Modifiers)
 
STATIC VOID EFIAPI InternalKeyStrokePollNotifyFunction (IN EFI_EVENT Event, IN VOID *Context)
 
STATIC VOID InternalInitializeKeyHandler (VOID)
 
EFI_STATUS EventCreateKeyStrokePollEvent (VOID)
 
VOID EventCancelKeyStrokePollEvent (VOID)
 
EFI_STATUS EFIAPI EventIsCapsLockOnImpl (IN OUT BOOLEAN *CLockOn)
 

Variables

STATIC BOOLEAN mCLockOn = FALSE
 
STATIC EFI_EVENT mKeyStrokePollEvent = NULL
 
STATIC APPLE_MODIFIER_MAP mModifiers = 0
 
STATIC APPLE_MODIFIER_MAP mPreviousModifiers = 0
 
STATIC BOOLEAN mInitialized = FALSE
 
STATIC KEY_STROKE_INFORMATION mKeyStrokeInfo [10]
 
STATIC BOOLEAN mCLockChanged = FALSE
 
STATIC UINTN mKeyInitialDelay = 50
 
STATIC UINTN mKeySubsequentDelay = 5
 
STATIC BOOLEAN mGraphicsInputMirroring = FALSE
 
STATIC APPLE_KEY_MAP_AGGREGATOR_PROTOCOLmKeyMapAggregator = NULL
 

Detailed Description

AppleEventDxe

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 KeyHandler.c.

Macro Definition Documentation

◆ KEY_STROKE_DELAY

#define KEY_STROKE_DELAY   5

Definition at line 36 of file KeyHandler.c.

◆ KEY_STROKE_POLL_FREQUENCY

#define KEY_STROKE_POLL_FREQUENCY   EFI_TIMER_PERIOD_MILLISECONDS (10)

Definition at line 39 of file KeyHandler.c.

Function Documentation

◆ EventCancelKeyStrokePollEvent()

VOID EventCancelKeyStrokePollEvent ( VOID )

Definition at line 778 of file KeyHandler.c.

◆ EventCreateKeyStrokePollEvent()

EFI_STATUS EventCreateKeyStrokePollEvent ( VOID )

Definition at line 744 of file KeyHandler.c.

◆ EventIsCapsLockOnImpl()

EFI_STATUS EFIAPI EventIsCapsLockOnImpl ( IN OUT BOOLEAN * CLockOn)

Retrieves the state of the CapsLock key.

Parameters
[in,out]CLockOnThis parameter indicates the state of the CapsLock key.
Return values
EFI_SUCCESSThe CapsLock state was successfully returned in CLockOn.
EFI_INVALID_PARAMETERCLockOn is NULL.

Definition at line 802 of file KeyHandler.c.

◆ InternalAppleEventDataFromCurrentKeyStroke()

STATIC EFI_STATUS InternalAppleEventDataFromCurrentKeyStroke ( IN OUT APPLE_EVENT_DATA * EventData,
IN OUT APPLE_MODIFIER_MAP * Modifiers )

Definition at line 575 of file KeyHandler.c.

◆ InternalAppleKeyEventDataFromInputKey()

STATIC EFI_STATUS InternalAppleKeyEventDataFromInputKey ( OUT APPLE_EVENT_DATA * EventData,
IN APPLE_KEY_CODE * AppleKeyCode,
IN EFI_INPUT_KEY * InputKey )

Definition at line 211 of file KeyHandler.c.

◆ InternalGetAndRemoveReleasedKeys()

STATIC UINTN InternalGetAndRemoveReleasedKeys ( IN CONST UINTN * NumberOfKeyCodes,
IN CONST APPLE_KEY_CODE * KeyCodes,
OUT APPLE_KEY_CODE ** ReleasedKeys )

Definition at line 250 of file KeyHandler.c.

◆ InternalGetAppleKeyStrokes()

STATIC EFI_STATUS InternalGetAppleKeyStrokes ( OUT APPLE_MODIFIER_MAP * Modifiers,
OUT UINTN * NumberOfKeyCodes,
OUT APPLE_KEY_CODE ** KeyCodes )

Definition at line 115 of file KeyHandler.c.

◆ InternalGetCurrentKeyStroke()

STATIC EFI_STATUS InternalGetCurrentKeyStroke ( IN APPLE_MODIFIER_MAP Modifiers,
IN OUT UINTN * NumberOfKeyCodes,
IN OUT APPLE_KEY_CODE * KeyCodes,
IN OUT EFI_INPUT_KEY * Key )

Definition at line 403 of file KeyHandler.c.

◆ InternalGetCurrentStroke()

STATIC KEY_STROKE_INFORMATION * InternalGetCurrentStroke ( VOID )

Definition at line 379 of file KeyHandler.c.

◆ InternalGetModifierStrokes()

APPLE_MODIFIER_MAP InternalGetModifierStrokes ( VOID )

Definition at line 180 of file KeyHandler.c.

◆ InternalInitializeKeyHandler()

STATIC VOID InternalInitializeKeyHandler ( VOID )

Definition at line 725 of file KeyHandler.c.

◆ InternalIsCLockOn()

STATIC BOOLEAN InternalIsCLockOn ( IN CONST UINTN * NumberOfKeyCodes,
IN CONST APPLE_KEY_CODE * KeyCodes )

Definition at line 328 of file KeyHandler.c.

◆ InternalKeyStrokePollNotifyFunction()

STATIC VOID EFIAPI InternalKeyStrokePollNotifyFunction ( IN EFI_EVENT Event,
IN VOID * Context )

Definition at line 668 of file KeyHandler.c.

◆ InternalSetKeyBehaviour()

VOID InternalSetKeyBehaviour ( IN BOOLEAN CustomDelays,
IN UINT16 KeyInitialDelay,
IN UINT16 KeySubsequentDelay,
IN BOOLEAN GraphicsInputMirroring )

Definition at line 83 of file KeyHandler.c.

Variable Documentation

◆ mCLockChanged

STATIC BOOLEAN mCLockChanged = FALSE

Definition at line 67 of file KeyHandler.c.

◆ mCLockOn

STATIC BOOLEAN mCLockOn = FALSE

Definition at line 49 of file KeyHandler.c.

◆ mGraphicsInputMirroring

STATIC BOOLEAN mGraphicsInputMirroring = FALSE

Definition at line 76 of file KeyHandler.c.

◆ mInitialized

STATIC BOOLEAN mInitialized = FALSE

Definition at line 61 of file KeyHandler.c.

◆ mKeyInitialDelay

STATIC UINTN mKeyInitialDelay = 50

Definition at line 72 of file KeyHandler.c.

◆ mKeyMapAggregator

STATIC APPLE_KEY_MAP_AGGREGATOR_PROTOCOL* mKeyMapAggregator = NULL

Definition at line 79 of file KeyHandler.c.

◆ mKeyStrokeInfo

STATIC KEY_STROKE_INFORMATION mKeyStrokeInfo[10]

Definition at line 64 of file KeyHandler.c.

◆ mKeyStrokePollEvent

STATIC EFI_EVENT mKeyStrokePollEvent = NULL

Definition at line 52 of file KeyHandler.c.

◆ mKeySubsequentDelay

STATIC UINTN mKeySubsequentDelay = 5

Definition at line 73 of file KeyHandler.c.

◆ mModifiers

STATIC APPLE_MODIFIER_MAP mModifiers = 0

Definition at line 55 of file KeyHandler.c.

◆ mPreviousModifiers

STATIC APPLE_MODIFIER_MAP mPreviousModifiers = 0

Definition at line 58 of file KeyHandler.c.