[ros-kernel] [reactos] keyboard dead char from dll

jeanmichel.123 at free.fr jeanmichel.123 at free.fr
Wed Nov 12 15:55:19 CET 2003


> > I tested the keypad keys this weekend and made some changes for keypad and
> > capslock.  I'll send a patch a bit later, after updating with your alt+gr
> > changes.  The reason they didn't work before is that we're expected to
> > generate VK_NUMPAD* if numlock is toggled.  I added some state to win32k
> > that allows that to work.

I can not test new modification as I have ntfs and it is not compatible with 
reactos.

However, before using ntfs I had tried to modify keyboard.c in order to use 
accent from the "local keyboard dynamic linked library" instead of the 
win32k.sys one.

It does not work, and I did not understand why.

Might be a missing sign extention from 8 bits to 16 bits?

For interested people, the buggy patch is included within this mail.



-------------- next part --------------
Index: keyboard.c
===================================================================
RCS file: /CVS/ReactOS/reactos/subsys/win32k/ntuser/keyboard.c,v
retrieving revision 1.14
diff -d -u -r1.14 keyboard.c
--- keyboard.c	7 Nov 2003 19:58:43 -0000	1.14
+++ keyboard.c	12 Nov 2003 15:52:47 -0000
@@ -292,7 +292,7 @@
 	      if( *pbDead ) 
 	        {
                   vkPtr = (PVK_TO_WCHARS10)(((BYTE *)vkPtr) + size_this_entry);
-	          if( vkPtr->VirtualKey != 0xff ) 
+	          if( (vkPtr->VirtualKey&0x00ff) != 0xff ) 
 	            {
 	              DPRINT( "Found dead key with no trailer in the table.\n" );
 	              DPRINT( "VK: %04x, ADDR: %08x\n", wVirtKey, (int)vkPtr );
@@ -667,6 +667,59 @@
   if (UState == 1)
     {
       NewMsg.message = (InMsg.message == WM_KEYDOWN) ? WM_CHAR : WM_SYSCHAR;
+DPRINT1 ("dead char is : %4.4x,%c\n",dead_char,dead_char);
+      if (dead_char)
+        {
+	  ULONG i;
+	PDEADKEY  lkey_accent_chars ;
+	  
+	  if (wp[0] == ' ') wp[0] =  dead_char;
+	  if (dead_char == 0xa2) dead_char = '(';
+	  else if (dead_char == 0xa8) dead_char = '"';
+	  else if (dead_char == 0xb2) dead_char = ';';
+	  else if (dead_char == 0xb4) dead_char = '\'';
+	  else if (dead_char == 0xb7) dead_char = '<';
+	  else if (dead_char == 0xb8) dead_char = ',';
+	  else if (dead_char == 0xff) dead_char = '.';
+	
+	lkey_accent_chars = keyLayout->pDeadKey;
+
+DPRINT1 ("dead char is : %4.4x,%c\n",dead_char,dead_char);
+	  for (i = 0; 
+		//i < sizeof(lkey_accent_chars)/sizeof(lkey_accent_chars[0])
+		(lkey_accent_chars[i].wchComposed != 0) &&
+		(lkey_accent_chars[i].dwBoth != 0)
+		; i++)
+	    {
+DPRINT1 ("\n test ac : %4.4x vs %4.4x", 
+		((lkey_accent_chars[i].dwBoth>>16)& 0x0000ffff), 
+			dead_char );
+DPRINT1 ("\n test ch : %4.4x vs %4.4x", 
+			(lkey_accent_chars[i].dwBoth & 0x0000ffff) , 
+			wp[0] );
+			//);
+// lkey_accent_chars[i].uFlags // FIXME what to do with it?
+	      if ( ( ((lkey_accent_chars[i].dwBoth>>16)& 0x0000ffff) == dead_char) &&
+		  ( (lkey_accent_chars[i].dwBoth & 0x0000ffff) == wp[0]))
+                {
+		  wp[0] = lkey_accent_chars[i].wchComposed;
+		      dead_char = 0;
+		  break;
+                }
+	    }
+
+
+DPRINT1 ("\nlast test ch : %4.4x vs %4.4x", 
+			lkey_accent_chars[i].wchComposed , 
+			wp[0] );
+DPRINT1 ("\nlast test re : %4.4x => %d\n", 
+			lkey_accent_chars[i].dwBoth , 
+	       ((lkey_accent_chars[i].uFlags == dead_char) &&
+		  (lkey_accent_chars[i].wchComposed == wp[0]))
+
+			);
+
+        }
       if (dead_char)
         {
 	  ULONG i;
@@ -685,16 +738,17 @@
 		  (accent_chars[i].ac_char == wp[0]))
                 {
 		  wp[0] = accent_chars[i].ac_result;
+		      dead_char = 0;
 		  break;
                 }
 	    }
-	      dead_char = 0;
         }
+	dead_char = 0;
       NewMsg.hwnd = InMsg.hwnd;
       NewMsg.wParam = wp[0];
       NewMsg.lParam = InMsg.lParam;
       UMsg = MsqCreateMessage(&NewMsg);
-      DPRINT( "CHAR='%c' %04x %08x\n", wp[0], wp[0], InMsg.lParam );
+      DPRINT1( "CHAR='%c' %04x %08x\n", wp[0], wp[0], InMsg.lParam );
       MsqPostMessage(PsGetWin32Thread()->MessageQueue, UMsg);
       return(TRUE);
     }
@@ -706,6 +760,7 @@
       NewMsg.wParam = wp[0];
       NewMsg.lParam = InMsg.lParam;
       dead_char = wp[0];
+DPRINT1 ("dead char is : %4.4x,%c\n",dead_char,dead_char);
       UMsg = MsqCreateMessage(&NewMsg);
       MsqPostMessage(PsGetWin32Thread()->MessageQueue, UMsg);
       return(TRUE);


More information about the Ros-kernel mailing list