Global variables have been moved backward ahead of functions.

Only a few cases were left due to its module structure.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6816 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jji4
2008-12-03 08:52:39 +00:00
parent 4058e906c1
commit aa79b0b379
34 changed files with 1386 additions and 797 deletions

View File

@@ -130,40 +130,6 @@ UINT8 KeyboardLayoutTable[USB_KEYCODE_MAX_MAKE + 8][5] = {
{EfiKeyA3, 0, 0, EFI_RIGHT_LOGO_MODIFIER, 0}, // 0xe7
};
/**
Initialize KeyConvertionTable by using default keyboard layout.
@param UsbKeyboardDevice The USB_KB_DEV instance.
@retval None.
**/
VOID
EFIAPI
LoadDefaultKeyboardLayout (
IN USB_KB_DEV *UsbKeyboardDevice
)
{
UINTN Index;
EFI_KEY_DESCRIPTOR *KeyDescriptor;
//
// Construct KeyConvertionTable by default keyboard layout
//
KeyDescriptor = &UsbKeyboardDevice->KeyConvertionTable[0];
for (Index = 0; Index < (USB_KEYCODE_MAX_MAKE + 8); Index++) {
KeyDescriptor->Key = (EFI_KEY) KeyboardLayoutTable[Index][0];
KeyDescriptor->Unicode = KeyboardLayoutTable[Index][1];
KeyDescriptor->ShiftedUnicode = KeyboardLayoutTable[Index][2];
KeyDescriptor->AltGrUnicode = 0;
KeyDescriptor->ShiftedAltGrUnicode = 0;
KeyDescriptor->Modifier = KeyboardLayoutTable[Index][3];
KeyDescriptor->AffectedAttribute = KeyboardLayoutTable[Index][4];
KeyDescriptor++;
}
}
//
// EFI_KEY to USB Scan Code convertion table
//
@@ -330,6 +296,40 @@ KB_MODIFIER KB_Mod[8] = {
};
/**
Initialize KeyConvertionTable by using default keyboard layout.
@param UsbKeyboardDevice The USB_KB_DEV instance.
@retval None.
**/
VOID
EFIAPI
LoadDefaultKeyboardLayout (
IN USB_KB_DEV *UsbKeyboardDevice
)
{
UINTN Index;
EFI_KEY_DESCRIPTOR *KeyDescriptor;
//
// Construct KeyConvertionTable by default keyboard layout
//
KeyDescriptor = &UsbKeyboardDevice->KeyConvertionTable[0];
for (Index = 0; Index < (USB_KEYCODE_MAX_MAKE + 8); Index++) {
KeyDescriptor->Key = (EFI_KEY) KeyboardLayoutTable[Index][0];
KeyDescriptor->Unicode = KeyboardLayoutTable[Index][1];
KeyDescriptor->ShiftedUnicode = KeyboardLayoutTable[Index][2];
KeyDescriptor->AltGrUnicode = 0;
KeyDescriptor->ShiftedAltGrUnicode = 0;
KeyDescriptor->Modifier = KeyboardLayoutTable[Index][3];
KeyDescriptor->AffectedAttribute = KeyboardLayoutTable[Index][4];
KeyDescriptor++;
}
}
/**
Uses USB I/O to check whether the device is a USB Keyboard device.