Skip to content

Commit

Permalink
HotKeys: Add OC_INPUT_TYPING_CONFIRM
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebeaton committed Mar 23, 2021
1 parent 77e2614 commit 5e6089e
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions Library/OcBootManagementLib/HotKeySupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,22 +404,10 @@ OcGetPickerKeyInfo (
}

//
// Handle typing
// Handle typing chars.
//
if (FilterForTyping) {
if (UnicodeChar >= 32 && UnicodeChar < 128) {
PickerKeyInfo->TypingChar = (CHAR8)UnicodeChar;
}

if (OcKeyMapHasKey (Keys, NumKeys, AppleHidUsbKbUsageKeyEscape)) {
PickerKeyInfo->OcKeyCode = OC_INPUT_TYPING_CLEAR_ALL;
return;
}

if (OcKeyMapHasKey (Keys, NumKeys, AppleHidUsbKbUsageKeyBackSpace)) {
PickerKeyInfo->OcKeyCode = OC_INPUT_TYPING_BACKSPACE;
return;
}
if (FilterForTyping && UnicodeChar >= 32 && UnicodeChar < 128) {
PickerKeyInfo->TypingChar = (CHAR8)UnicodeChar;
}

//
Expand Down Expand Up @@ -470,6 +458,23 @@ OcGetPickerKeyInfo (
PickerKeyInfo->OcKeyCode = OC_INPUT_TYPING_RIGHT;
return;
}

if (Keys[0] == AppleHidUsbKbUsageKeyEscape) {
PickerKeyInfo->OcKeyCode = OC_INPUT_TYPING_CLEAR_ALL;
return;
}

if (Keys[0] ==AppleHidUsbKbUsageKeyBackSpace) {
PickerKeyInfo->OcKeyCode = OC_INPUT_TYPING_BACKSPACE;
return;
}

if (Keys[0] == AppleHidUsbKbUsageKeyEnter
|| Keys[0] == AppleHidUsbKbUsageKeyReturn
|| Keys[0] == AppleHidUsbKbUsageKeyPadEnter) {
PickerKeyInfo->OcKeyCode = OC_INPUT_TYPING_CONFIRM;
return;
}
} else {
//
// Non-typing index key strokes.
Expand Down

0 comments on commit 5e6089e

Please sign in to comment.