[ros-diffs] [rharabien] 56046: [HIDPARSER] - Fix scan-codes for PrintScreen and PauseBreak

rharabien at svn.reactos.org rharabien at svn.reactos.org
Mon Mar 5 19:07:02 UTC 2012


Author: rharabien
Date: Mon Mar  5 19:07:01 2012
New Revision: 56046

URL: http://svn.reactos.org/svn/reactos?rev=56046&view=rev
Log:
[HIDPARSER]
- Fix scan-codes for PrintScreen and PauseBreak

Modified:
    trunk/reactos/lib/drivers/hidparser/api.c

Modified: trunk/reactos/lib/drivers/hidparser/api.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/hidparser/api.c?rev=56046&r1=56045&r2=56046&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/hidparser/api.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/hidparser/api.c [iso-8859-1] Mon Mar  5 19:07:01 2012
@@ -17,7 +17,7 @@
 /* 1 */ 0x0032, 0x0031, 0x0018, 0x0019, 0x0010, 0x0013, 0x001f, 0x0014, 0x0016, 0x002f, 0x0011, 0x002d, 0x0015, 0x002c, 0x0002, 0x0003,
 /* 2 */ 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x001c, 0x0001, 0x000e, 0x000f, 0x0039, 0x000c, 0x000d, 0x001a,
 /* 3 */ 0x001b, 0x002b, 0x002b, 0x0027, 0x0028, 0x0029, 0x0033, 0x0034, 0x0035, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040,
-/* 4 */ 0x0041, 0x0042, 0x0043, 0x0044, 0x0057, 0x0058, 0x0063, 0x0046, 0x0077, 0xE052, 0xE047, 0xE049, 0xE053, 0xE04F, 0xE051, 0xE04D,
+/* 4 */ 0x0041, 0x0042, 0x0043, 0x0044, 0x0057, 0x0058, 0xE037, 0x0046, 0x0045, 0xE052, 0xE047, 0xE049, 0xE053, 0xE04F, 0xE051, 0xE04D,
 /* 5 */ 0xE04B, 0xE050, 0xE048, 0x0045, 0xE035, 0x0037, 0x004a, 0x004e, 0xE01C, 0x004f, 0x0050, 0x0051, 0x004b, 0x004c, 0x004d, 0x0047,
 /* 6 */ 0x0048, 0x0049, 0x0052, 0x0053, 0x0056, 0xE05D, 0xE05E, 0x0075, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be,
 /* 7 */ 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x0086, 0x008a, 0x0082, 0x0084, 0x0080, 0x0081, 0x0083, 0x0089, 0x0085, 0x0087, 0x0088, 0x0071,
@@ -723,6 +723,8 @@
     IN PVOID  InsertCodesContext)
 {
     ULONG ScanCode;
+    CHAR FakeShift[] = {0xE0, 0x2A, 0x00};
+    CHAR FakeCtrl[] = {0xE1, 0x1D, 0x00};
 
     //
     // get scan code
@@ -737,7 +739,7 @@
         return HIDPARSER_STATUS_I8042_TRANS_UNKNOWN;
     }
 
-    if ((ScanCode & 0xE000) == 0xE000)
+    if (ScanCode & 0xFF00)
     {
         //
         // swap scan code
@@ -745,11 +747,29 @@
         ScanCode = NTOHS(ScanCode);
     }
 
+    if (Usage == 0x46 && KeyAction == HidP_Keyboard_Make)
+    {
+        // Print Screen generates additional FakeShift
+        HidParser_DispatchKey(FakeShift, KeyAction, InsertCodesProcedure, InsertCodesContext);
+    }
+
+    if (Usage == 0x48)
+    {
+        // Pause/Break generates additional FakeCtrl. Note: it's always before key press/release.
+        HidParser_DispatchKey(FakeCtrl, KeyAction, InsertCodesProcedure, InsertCodesContext);
+    }
+
     //
     // FIXME: translate modifier states
     //
     HidParser_DispatchKey((PCHAR)&ScanCode, KeyAction, InsertCodesProcedure, InsertCodesContext);
 
+    if (Usage == 0x46 && KeyAction == HidP_Keyboard_Break)
+    {
+        // Print Screen generates additional FakeShift
+        HidParser_DispatchKey(FakeShift, KeyAction, InsertCodesProcedure, InsertCodesContext);
+    }
+
     //
     // done
     //




More information about the Ros-diffs mailing list