{ 0,0 } ,
{ ' ',' ' } ,
};
-
+
/* EXTENDED KEY TABLE *********************************************************/
UCHAR LlbHwExtendedScanCodeTable[128] =
/* FUNCTIONS ******************************************************************/
USHORT LlbKbdLastScanCode;
-
+
UCHAR
NTAPI
LlbKbdTranslateScanCode(IN USHORT ScanCode,
IN PUCHAR KeyCode)
{
ULONG LastScanCode;
-
+
/* Check for extended scan codes */
if ((ScanCode == 0xE0) || (ScanCode == 0xE1))
{
LlbKbdLastScanCode = 0;
return 0;
}
-
+
/* Only act on the break, not the make */
if (ScanCode > 0x80) return 0;
{
/* E0 extended codes */
case 0xE0:
-
+
/* Skip bogus codes */
if ((ScanCode == 0x2A) || (ScanCode == 0x36)) return 0;
-
+
/* Lookup the code for it */
if (!LlbHwExtendedScanCodeTable[ScanCode]) return 0;
*KeyCode = LlbHwExtendedScanCodeTable[ScanCode];
/* E1 extended codes */
case 0xE1:
-
+
/* Only recognize one (the SYSREQ/PAUSE sequence) */
if (ScanCode != 0x1D) return 0;
LlbKbdLastScanCode = 0x100;
/* PAUSE sequence */
case 0x100:
-
+
/* Make sure it's the one */
if (ScanCode != 0x45) return 0;
*KeyCode = E1_PAUSE;
/* Translation success */
return 1;
}
-
+
CHAR
NTAPI
LlbKeyboardGetChar(VOID)
{
UCHAR ScanCode, KeyCode;
-
+
do
{
/* Read the scan code and convert it to a virtual key code */
ScanCode = LlbHwKbdRead();
} while (!LlbKbdTranslateScanCode(ScanCode, &KeyCode));
-
+
/* Is this ASCII? */
if (KeyCode > 96) return ScanCode;
-
+
/* Return the ASCII character */
return LlbHwScanCodeToAsciiTable[KeyCode][0];
}