OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
InputSimTextIn.c
Go to the documentation of this file.
1
8#include <Uefi.h>
9
11
12#include <Library/DebugLib.h>
15#include <Library/OcMiscLib.h>
16#include <Library/UefiBootServicesTableLib.h>
17
18#include "../GuiIo.h"
19
22 IN OC_PICKER_CONTEXT *PickerContext
23 )
24{
25 STATIC GUI_KEY_CONTEXT mContext;
26
27 mContext.Context = PickerContext;
28
29 return &mContext;
30}
31
32BOOLEAN
34 IN OUT GUI_KEY_CONTEXT *Context,
35 OUT GUI_KEY_EVENT *Event
36 )
37{
38 ASSERT (Context != NULL);
39 ASSERT (Event != NULL);
40
41 Context->Context->HotKeyContext->GetKeyInfo (
42 Context->Context,
43 Context->KeyFilter,
44 Event
45 );
46
47 if ( (Context->KeyFilter == OC_PICKER_KEYS_FOR_PICKER)
48 && (Context->OcModifiers != Event->OcModifiers))
49 {
50 Context->OcModifiers = Event->OcModifiers;
51 return TRUE;
52 }
53
54 if ( (Context->KeyFilter == OC_PICKER_KEYS_FOR_TYPING)
55 && (Event->UnicodeChar != L'\0'))
56 {
57 return TRUE;
58 }
59
60 return Event->OcKeyCode != OC_INPUT_NO_ACTION;
61}
62
63VOID
64EFIAPI
66 IN OUT GUI_KEY_CONTEXT *Context
67 )
68{
69 ASSERT (Context != NULL);
70 //
71 // Flush console here?
72 //
73 Context->Context->HotKeyContext->FlushTypingBuffer (Context->Context);
74}
75
76VOID
78 IN GUI_KEY_CONTEXT *Context
79 )
80{
81 ASSERT (Context != NULL);
82 ZeroMem (Context, sizeof (*Context));
83}
BOOLEAN GuiKeyGetEvent(IN OUT GUI_KEY_CONTEXT *Context, OUT GUI_KEY_EVENT *Event)
GUI_KEY_CONTEXT * GuiKeyConstruct(IN OC_PICKER_CONTEXT *PickerContext)
VOID EFIAPI GuiKeyReset(IN OUT GUI_KEY_CONTEXT *Context)
VOID GuiKeyDestruct(IN GUI_KEY_CONTEXT *Context)
#define OC_PICKER_KEYS_FOR_TYPING
#define OC_PICKER_KEYS_FOR_PICKER
#define OC_INPUT_NO_ACTION
Some other key.
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define ASSERT(x)
Definition coder.h:55
OC_PICKER_CONTEXT * Context
Definition OpenCanopy.h:43