diff -u -r pnpi8042.orig/i8042prt.h pnpi8042/i8042prt.h
--- pnpi8042.orig/i8042prt.h	2000-07-26 17:35:44.000000000 +0100
+++ pnpi8042/i8042prt.h	2009-08-16 21:24:47.000000000 +0100
@@ -447,6 +447,8 @@
 #define SELECT_SCAN_CODE_SET              0xF0
 #define READ_KEYBOARD_ID                  0xF2
 #define SET_KEYBOARD_TYPEMATIC            0xF3
+#define SET_ALL_KEYS_TYPEMATIC			  0xF7
+#define SET_ALL_KEYS_MAKE_BREAK			  0xF8
 #define SET_ALL_TYPEMATIC_MAKE_BREAK      0xFA
 #define KEYBOARD_RESET                    0xFF
 
diff -u -r pnpi8042.orig/kbddep.c pnpi8042/kbddep.c
--- pnpi8042.orig/kbddep.c	2000-07-26 17:35:52.000000000 +0100
+++ pnpi8042/kbddep.c	2009-08-21 19:21:13.000000000 +0100
@@ -441,6 +441,7 @@
 #endif // defined(NEC_98)
                 switch (*scanState) {
                   case Normal:
+/* [JCE] In Set 3, scancodes E0 and E1 have no special meaning 
                     if (scanCode == (UCHAR) 0xE0) {
                         input->Flags |= KEY_E0;
                         *scanState = GotE0;
@@ -457,7 +458,7 @@
                     // Fall through to the GotE0/GotE1 case for the rest of the
                     // Normal case.
                     //
-
+*/
                   case GotE0:
                   case GotE1:
 
@@ -1023,6 +1024,7 @@
 #define KB_INIT_FAILED_SET_LEDS_PARAM       0x00002000
 #define KB_INIT_FAILED_SELECT_SS            0x00010000
 #define KB_INIT_FAILED_SELECT_SS_PARAM      0x00020000
+#define KB_INIT_FAILED_SET_ALL_MAKE_BREAK   0x00040000
 
 #if KEYBOARD_RECORD_INIT
 
@@ -1070,9 +1072,9 @@
     ULONG                               i;
     ULONG                               limit;
     PIO_ERROR_LOG_PACKET                errorLogEntry;
-    ULONG                               uniqueErrorValue;
+    ULONG                               uniqueErrorValue = 0;
     NTSTATUS                            errorCode = STATUS_SUCCESS;
-    ULONG                               dumpCount;
+    ULONG                               dumpCount = 0;
     PI8042_CONFIGURATION_INFORMATION    configuration;
     PKEYBOARD_ID                        keyboardId;
     LARGE_INTEGER                       startOfSpin,
@@ -1083,6 +1085,7 @@
     BOOLEAN                             waitForAckOnReset = WAIT_FOR_ACKNOWLEDGE,
                                         translationOn = TRUE,
                                         failedReset = FALSE,
+										failedAllRepeat = FALSE,
                                         failedTypematic = FALSE,
                                         failedLeds = FALSE;
     
@@ -1118,6 +1121,14 @@
 
     NEC98_EnableExtKeys();
 #else // defined(NEC_98)
+
+// [JCE] Resetting a terminal keyboard makes it send two ID bytes 
+// after the 0xAA. These collide head-on with the commands sent by
+// Windows to set the LEDs and typematic rate, and the keyboard
+// ends up sulking.
+//
+// Solution: Comment out the reset.
+/*
 StartOfReset:
     status = I8xPutBytePolled(
                  (CCHAR) DataPort,
@@ -1285,7 +1296,7 @@
 
         goto I8xInitializeKeyboardExit;
     }
-
+*/
     //
     // Turn off Keyboard Translate Mode.  Call I8xTransmitControllerCommand
     // to read the Controller Command Byte, modify the appropriate bits, and
@@ -1325,6 +1336,39 @@
 
     id = &deviceExtension->KeyboardAttributes.KeyboardIdentifier;
 
+// [JCE] Set all keys to give make/break codes. It seems that on a terminal
+// keyboard, keys can be made to repeat or to send make/break codes, but 
+// not both.
+    if ((status = I8xPutBytePolled(
+                      (CCHAR) DataPort,
+                      WAIT_FOR_ACKNOWLEDGE,
+                      (CCHAR) KeyboardDeviceType,
+                      (UCHAR) SET_ALL_KEYS_MAKE_BREAK
+                      )) != STATUS_SUCCESS) {
+
+        SET_KB_INIT_FAILURE(KB_INIT_FAILED_SET_ALL_MAKE_BREAK);
+        failedAllRepeat = TRUE;
+
+        Print(DBG_SS_ERROR,
+              ("I8xInitializeKeyboard: could not send SET ALL KEYS REPEAT cmd\n"
+              ));
+
+        //
+        // Log an error.
+        //
+        dumpData[0] = KBDMOU_COULD_NOT_SEND_COMMAND;
+        dumpData[1] = DataPort;
+        dumpData[2] = SET_ALL_KEYS_MAKE_BREAK;
+
+        I8xLogError(
+            deviceObject,
+            I8042_SET_TYPEMATIC_FAILED,
+            I8042_ERROR_VALUE_BASE + 535,
+            status,
+            dumpData,
+            3
+            );
+	}
     //
     // Set the typematic rate and delay.  Send the Set Typematic Rate command
     // to the keyboard, followed by the typematic rate/delay parameter byte.
@@ -1733,7 +1777,7 @@
 
 I8xInitializeKeyboardExit:
 
-    if (failedReset && failedTypematic && failedLeds) {
+    if (failedReset && failedAllRepeat) {
         // set to io timeout so nec98 works correctly
         status = STATUS_IO_TIMEOUT;
         errorCode = I8042_NO_KBD_DEVICE;
