[HIDPARSE]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 1 Feb 2012 10:36:19 +0000 (10:36 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 1 Feb 2012 10:36:19 +0000 (10:36 +0000)
- Use report value when report item bitcount > 1
[KBDHID]
- Print raw report
- KBDHID starts to receive normal keys and modifier keys

svn path=/branches/usb-bringup-trunk/; revision=55364

drivers/hid/kbdhid/kbdhid.c
lib/drivers/hidparser/api.c
lib/drivers/hidparser/hidparser.c

index d24bece..4eafcec 100644 (file)
@@ -94,6 +94,15 @@ KbdHid_ReadCompletion(
         return STATUS_MORE_PROCESSING_REQUIRED;
     }
 
+    //
+    // print out raw report
+    //
+    ASSERT(DeviceExtension->ReportLength >= 9);
+    DPRINT1("[KBDHID] ReadCompletion %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", DeviceExtension->Report[0], DeviceExtension->Report[1], DeviceExtension->Report[2],
+        DeviceExtension->Report[3], DeviceExtension->Report[4], DeviceExtension->Report[5],
+        DeviceExtension->Report[6], DeviceExtension->Report[7], DeviceExtension->Report[8]);
+
+
     /* get current usages */
     ButtonLength = DeviceExtension->UsageListLength;
     Status = HidP_GetUsagesEx(HidP_Input, HIDP_LINK_COLLECTION_UNSPECIFIED, DeviceExtension->CurrentUsageList, &ButtonLength, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength);
index 2508395..8d5859c 100644 (file)
@@ -455,7 +455,20 @@ HidParser_GetUsagesWithReport(
             //
             // store usage and page
             //
-            UsageAndPage[ItemCount].Usage = (ReportItem->UsageMinimum & 0xFFFF);
+            if (ReportItem->BitCount == 1)
+            {
+                //
+                // use usage minimum
+                //
+                UsageAndPage[ItemCount].Usage =(ReportItem->UsageMinimum & 0xFFFF);
+            }
+            else
+            {
+                //
+                // use value from control
+                //
+                UsageAndPage[ItemCount].Usage = (USHORT)Data;
+            }
             UsageAndPage[ItemCount].UsagePage = CurrentUsagePage;
         }
         ItemCount++;
@@ -691,13 +704,14 @@ HidParser_TranslateUsage(
         //
         // invalid lookup or no scan code available
         //
+        DPRINT1("No Scan code for Usage %x\n", Usage);
         return HIDPARSER_STATUS_I8042_TRANS_UNKNOWN;
     }
 
     //
     // FIXME: translate modifier states
     //
-
+       DPRINT1("Usage %x ScanCode %x\n", Usage, ScanCode);
     HidParser_DispatchKey((PCHAR)&ScanCode, KeyAction, InsertCodesProcedure, InsertCodesContext);
 
     //
index 402f7fd..2e78d46 100644 (file)
@@ -683,9 +683,8 @@ HidParser_TranslateUsageAndPagesToI8042ScanCodes(
         else
         {
             //
-            // invalid page
+            // invalid page / end of usage list page
             //
-            DPRINT1("[HIDPARSE] Error unexpected usage page %x\n", ChangedUsageList[Index].UsagePage);
             return HIDP_STATUS_I8042_TRANS_UNKNOWN;
         }