[DInput] Additionnal keyboard logging.

Lionel Ulmer lionel.ulmer at free.fr
Mon Apr 12 09:52:26 CDT 2004


A game I am testing does funky stuff because key '0' seems to be pressed (so
it gives me a one second penality when the red lights disappear as it
believes I pressed a key too early :-) ).

This patch is currently helping me debug the issue (i.e. how comes that this
'0' key is pressed).

Changelog:
 - log better the GetDeviceState function
 - log changes to the DInputKeyState table

-- 
		 Lionel Ulmer - http://www.bbrox.org/
-------------- next part --------------
Index: dlls/dinput/keyboard.c
===================================================================
RCS file: /home/wine/wine/dlls/dinput/keyboard.c,v
retrieving revision 1.1
diff -u -r1.1 keyboard.c
--- dlls/dinput/keyboard.c	12 Feb 2004 23:28:00 -0000	1.1
+++ dlls/dinput/keyboard.c	12 Apr 2004 14:49:22 -0000
@@ -105,7 +105,8 @@
       }
 
       DInputKeyState[dik_code] = (down ? 0x80 : 0);
-
+      TRACE(" setting %02X to %02X\n", dik_code, DInputKeyState[dik_code]);
+      
       if (current != NULL)
         {
           if (current->hEvent)
@@ -360,6 +361,15 @@
 
     MsgWaitForMultipleObjectsEx(0, NULL, 0, 0, 0);
 
+    if (TRACE_ON(dinput)) {
+	int i;
+	for (i = 0; i < 256; i++) {
+	    if (DInputKeyState[i] != 0x00) {
+		TRACE(" - %02X: %02x\n", i, DInputKeyState[i]);
+	    }
+	}
+    }
+    
     memcpy(ptr, DInputKeyState, 256);
     return DI_OK;
 }


More information about the wine-patches mailing list