... resent with patch inline ...

Well... dead keys in winvncviewer 3.3.7 actually do not work and all patches
I found in this mailing list are not satisfactory to me, so I wrote my own
patch to make dead keys OK for me (Swiss french keyboard). I do not have
info about other national keyboards with dead keys, but it should work for
most of them... perhaps some other dead key codes will have to be added.

Please find the patch in attachment. I hope it can help someone... and that
the problem will be fixed in the next release.

Patrick



--- vncviewer/KeyMap.cpp.old    2002-10-25 18:13:18.000000000 +0200
+++ vncviewer/KeyMap.cpp        2003-05-16 18:38:22.000000000 +0200
@@ -211,9 +211,32 @@
            } 
 
         } 
-        
-        // If not a ctrl-alt key
-        if (numkeys == 0) {
+
+       // Check if it is a dead key.
+       // If so, the previous call to ToAscii() has recorded it: by
+        //     following it with a space, we can retrieve its character
+       //      representation.
+
+       if (ret < 0) {
+            keystate[VK_CONTROL] = keystate[VK_LCONTROL] =
keystate[VK_RCONTROL] = 0;
+           int ret = ::ToAscii(' ', 0, keystate, (WORD *) buf, 0);
+
+           if (ret > 0)
+                switch (*buf & 0xFF) {
+               case '`' :
+                       kas.keycodes[numkeys++] = XK_dead_grave; break;
+               case '\'' :
+               case 0xB4:
+                       kas.keycodes[numkeys++] = XK_dead_acute; break;
+               case '~' :
+                       kas.keycodes[numkeys++] = XK_dead_tilde; break;
+               case '^':
+                       kas.keycodes[numkeys++] = XK_dead_circumflex; break;
+               case '"':
+                       kas.keycodes[numkeys++] = XK_dead_diaeresis; break;
+               }
+       }
+       else if (numkeys == 0) {
 
             // There are no keysyms corresponding to control characters 
             // Eg Ctrl F.  The server already knows whether the control 
@@ -222,18 +245,6 @@
             keystate[VK_CONTROL] = keystate[VK_LCONTROL] =
keystate[VK_RCONTROL] = 0;
 
                    int ret = ::ToAscii(virtkey, 0, keystate, (WORD *) buf,
0);
-            if (ret < 0) {
-                switch (*buf) {
-                               case '`' :
-                                       kas.keycodes[numkeys++] =
XK_dead_grave; break;
-                               case '\'' :
-                                       kas.keycodes[numkeys++] =
XK_dead_acute; break;
-                               case '~' :
-                                       kas.keycodes[numkeys++] =
XK_dead_tilde; break;
-                               case '^':
-                                       kas.keycodes[numkeys++] =
XK_dead_circumflex; break;
-                               }
-            }
             // if this works, and it's a regular printable character, we
just send that
             if (ret >= 1) {
                 log.Print(8,_T("ToAscii (without ctrl) returns %d byte(s):
"), ret);
--- vncviewer/keysymdef.h.old   2002-06-18 15:53:50.000000000 +0200
+++ vncviewer/keysymdef.h       2003-05-16 18:19:31.000000000 +0200
@@ -42,6 +42,7 @@
 #define XK_dead_acute       0xFE51
 #define XK_dead_circumflex  0xFE52
 #define XK_dead_tilde       0xFE53
+#define        XK_dead_diaeresis       0xFE57
 
 #define XK_Home                        0xFF50
 #define XK_Left                        0xFF51  
_______________________________________________
VNC-List mailing list
[EMAIL PROTECTED]
To remove yourself from the list visit:
http://www.realvnc.com/mailman/listinfo/vnc-list

Reply via email to