|
#define | KEYBOARD_TIMER_INTERVAL 200000 |
|
#define | MAX_KEY_ALLOWED 32 |
|
#define | HZ 1000 * 1000 * 10 |
|
#define | USBKBD_REPEAT_DELAY ((HZ) / 2) |
|
#define | USBKBD_REPEAT_RATE ((HZ) / 50) |
|
#define | CLASS_HID 3 |
|
#define | SUBCLASS_BOOT 1 |
|
#define | PROTOCOL_KEYBOARD 1 |
|
#define | BOOT_PROTOCOL 0 |
|
#define | REPORT_PROTOCOL 1 |
|
#define | USB_KB_DEV_SIGNATURE SIGNATURE_32 ('u', 'k', 'b', 'd') |
|
#define | USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('u', 'k', 'b', 'x') |
|
#define | USB_NS_KEY_SIGNATURE SIGNATURE_32 ('u', 'n', 's', 'k') |
|
#define | USB_NS_KEY_FORM_FROM_LINK(a) CR (a, USB_NS_KEY, Link, USB_NS_KEY_SIGNATURE) |
|
#define | USB_KB_DEV_FROM_THIS(a) CR(a, USB_KB_DEV, SimpleInput, USB_KB_DEV_SIGNATURE) |
|
#define | TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS(a) CR(a, USB_KB_DEV, SimpleInputEx, USB_KB_DEV_SIGNATURE) |
|
#define | NUMBER_OF_VALID_NON_MODIFIER_USB_KEYCODE 0x62 |
|
#define | NUMBER_OF_VALID_USB_KEYCODE 0x6A |
|
#define | USBKBD_VALID_KEYCODE(Key) ((UINT8) (Key) > 3) |
|
|
EFI_STATUS EFIAPI | USBKeyboardDriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath) |
|
EFI_STATUS EFIAPI | USBKeyboardDriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath) |
|
EFI_STATUS EFIAPI | USBKeyboardDriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer) |
|
EFI_STATUS EFIAPI | UsbKeyboardComponentNameGetDriverName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName) |
|
EFI_STATUS EFIAPI | UsbKeyboardComponentNameGetControllerName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName) |
|
EFI_STATUS EFIAPI | USBKeyboardReset (IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification) |
|
EFI_STATUS EFIAPI | USBKeyboardReadKeyStroke (IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, OUT EFI_INPUT_KEY *Key) |
|
EFI_STATUS EFIAPI | USBKeyboardResetEx (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN BOOLEAN ExtendedVerification) |
|
EFI_STATUS EFIAPI | USBKeyboardReadKeyStrokeEx (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, OUT EFI_KEY_DATA *KeyData) |
|
EFI_STATUS EFIAPI | USBKeyboardSetState (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_TOGGLE_STATE *KeyToggleState) |
|
EFI_STATUS EFIAPI | USBKeyboardRegisterKeyNotify (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_DATA *KeyData, IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, OUT VOID **NotifyHandle) |
|
EFI_STATUS EFIAPI | USBKeyboardUnregisterKeyNotify (IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN VOID *NotificationHandle) |
|
VOID EFIAPI | USBKeyboardWaitForKey (IN EFI_EVENT Event, IN VOID *Context) |
|
EFI_STATUS | KbdFreeNotifyList (IN OUT LIST_ENTRY *NotifyList) |
|
BOOLEAN | IsKeyRegistered (IN EFI_KEY_DATA *RegsiteredData, IN EFI_KEY_DATA *InputData) |
|
VOID EFIAPI | USBKeyboardTimerHandler (IN EFI_EVENT Event, IN VOID *Context) |
|
VOID EFIAPI | KeyNotifyProcessHandler (IN EFI_EVENT Event, IN VOID *Context) |
|
Header file for USB Keyboard Driver's Data Structures.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file EfiKey.h.
Check whether the pressed key matches a registered key or not.
- Parameters
-
RegsiteredData | A pointer to keystroke data for the key that was registered. |
InputData | A pointer to keystroke data for the key that was pressed. |
- Return values
-
TRUE | Key pressed matches a registered key. |
FALSE | Key pressed does not match a registered key. |
Judge whether is a registed key
- Parameters
-
RegsiteredData | A pointer to a buffer that is filled in with the keystroke state data for the key that was registered. |
InputData | A pointer to a buffer that is filled in with the keystroke state data for the key that was pressed. |
- Return values
-
TRUE | Key be pressed matches a registered key. |
FALSE | Match failed. |
Judge whether is a registered key
- Parameters
-
RegsiteredData | A pointer to a buffer that is filled in with the keystroke state data for the key that was registered. |
InputData | A pointer to a buffer that is filled in with the keystroke state data for the key that was pressed. |
- Return values
-
TRUE | Key be pressed matches a registered key. |
FALSE | Match failed. |
Check whether the pressed key matches a registered key or not.
- Parameters
-
RegsiteredData | A pointer to keystroke data for the key that was registered. |
InputData | A pointer to keystroke data for the key that was pressed. |
- Return values
-
TRUE | Key pressed matches a registered key. |
FALSE | Key pressed does not matches a registered key. |
Test if the key has been registered on input device.
- Parameters
-
RegsiteredData | A pointer to a buffer that is filled in with the keystroke state data for the key that was registered. |
InputData | A pointer to a buffer that is filled in with the keystroke state data for the key that was pressed. |
- Return values
-
TRUE | Key be pressed matches a registered key. |
FALSE | Match failed. |
Check if the key already has been registered.
If both RegsiteredData and InputData is NULL, then ASSERT().
- Parameters
-
RegsiteredData | A pointer to a buffer that is filled in with the keystroke state data for the key that was registered. |
InputData | A pointer to a buffer that is filled in with the keystroke state data for the key that was pressed. |
- Return values
-
TRUE | Key be pressed matches a registered key. |
FALSE | Match failed. |
Definition at line 448 of file VirtualKeyboard.c.
Retrieves a Unicode string that is the user readable name of the controller that is being managed by a driver.
This function retrieves the user readable name of the controller specified by ControllerHandle and ChildHandle in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the controller name is returned in ControllerName, and EFI_SUCCESS is returned. If the driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle, then EFI_UNSUPPORTED is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.
- Parameters
-
This | A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. |
ControllerHandle | The handle of a controller that the driver specified by This is managing. This handle specifies the controller whose name is to be returned. |
ChildHandle | The handle of the child controller to retrieve the name of. This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to retrieve the name of the bus controller. It will not be NULL for a bus driver that wishes to retrieve the name of a child controller. |
Language | A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format. |
ControllerName | A pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle in the language specified by Language from the point of view of the driver specified by This. |
- Return values
-
EFI_SUCCESS | The Unicode string for the user readable name in the language specified by Language for the driver specified by This was returned in DriverName. |
EFI_INVALID_PARAMETER | ControllerHandle is not a valid EFI_HANDLE. |
EFI_INVALID_PARAMETER | ChildHandle is not NULL and it is not a valid EFI_HANDLE. |
EFI_INVALID_PARAMETER | Language is NULL. |
EFI_INVALID_PARAMETER | ControllerName is NULL. |
EFI_UNSUPPORTED | The driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle. |
EFI_UNSUPPORTED | The driver specified by This does not support the language specified by Language. |
Retrieves a Unicode string that is the user readable name of the controller that is being managed by a driver.
This function retrieves the user readable name of the controller specified by ControllerHandle and ChildHandle in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the controller name is returned in ControllerName, and EFI_SUCCESS is returned. If the driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle, then EFI_UNSUPPORTED is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.
- Parameters
-
This | A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. |
ControllerHandle | The handle of a controller that the driver specified by This is managing. This handle specifies the controller whose name is to be returned. |
ChildHandle | The handle of the child controller to retrieve the name of. This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to retrieve the name of the bus controller. It will not be NULL for a bus driver that wishes to retrieve the name of a child controller. |
Language | A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format. |
ControllerName | A pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle in the language specified by Language from the point of view of the driver specified by This. |
- Return values
-
EFI_SUCCESS | The Unicode string for the user readable name in the language specified by Language for the driver specified by This was returned in DriverName. |
EFI_INVALID_PARAMETER | ControllerHandle is NULL. |
EFI_INVALID_PARAMETER | ChildHandle is not NULL and it is not a valid EFI_HANDLE. |
EFI_INVALID_PARAMETER | Language is NULL. |
EFI_INVALID_PARAMETER | ControllerName is NULL. |
EFI_UNSUPPORTED | The driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle. |
EFI_UNSUPPORTED | The driver specified by This does not support the language specified by Language. |
Definition at line 145 of file ComponentName.c.
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the driver name is returned in DriverName, and EFI_SUCCESS is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.
- Parameters
-
This | A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. |
Language | A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format. |
DriverName | A pointer to the Unicode string to return. This Unicode string is the name of the driver specified by This in the language specified by Language. |
- Return values
-
EFI_SUCCESS | The Unicode string for the Driver specified by This and the language specified by Language was returned in DriverName. |
EFI_INVALID_PARAMETER | Language is NULL. |
EFI_INVALID_PARAMETER | DriverName is NULL. |
EFI_UNSUPPORTED | The driver specified by This does not support the language specified by Language. |
Definition at line 70 of file ComponentName.c.
Reset the input device and optionally run diagnostics
There are 2 types of reset for USB keyboard. For non-exhaustive reset, only keyboard buffer is cleared. For exhaustive reset, in addition to clearance of keyboard buffer, the hardware status is also re-initialized.
- Parameters
-
This | Protocol instance pointer. |
ExtendedVerification | Driver may perform diagnostics on reset. |
- Return values
-
EFI_SUCCESS | The device was reset. |
EFI_DEVICE_ERROR | The device is not functioning properly and could not be reset. |
Definition at line 637 of file EfiKey.c.