Hello,

I noticed a very strange keyboard behavior with the Xvnc.

I am using a French keyboard. When I press the key 'asterisk' (located at
the left of <return> on a French keyboard), I get an '*'. OK. But if I run
the xev utility to know keyboard events generated by this, I get the
following:
   pressing <Shift Left>
   pressing <8> (above U and I)
   releasing <8>
   releasing <Shift Left>

This very strange behavior is inherited from a US keyboard (to get an
asterisk with an US keyboard, <Shift><8> is pressed).

You can say, this behavior is not very important because in final when <*>
is pressed, an <*> is got by an X application (xterm, kde ...).

But some X applications take care to the real keyboard event (they use
keycode instead of keysym). And in this case only a US keyboard can be
correctly use with the VNC server.

To solve this problem I modified the Xvnc source code (where a US keymap is
hard coded). I added a French and a UK keymap. Furthermore I specificied
keysyms use by the numpad. (Then the xmodmap table is entirely filled by the
Xvnc daemon itself).

To use this, one of the following compilation option must be set (in
/config/cf/xfree86.cf, variable Xfree86ServerDefines):
   -DNEW_US_KEYBOARD
   -DNEW_FR_KEYBOARD
   -DNEW_UK_KEYBOARD

But I am not an expert in C language. So I think my modification could be
improved:

   1 - I used a compilation option, but to make life easiest I think it will
be more elegant to offer a run-time option (Xvnc :1 -kbd fr ...) to set the
correct keymap.

  2 - The main difference between a vncviewer and the Linux box (if Xvnc is
used on linux) are the keycodes. And when an X application is based on
keycodes (instead of keysym), nothing works. So it could be a good idea to
simulate a PC keyboard with a correct kbdMap in kbdptr.c.

Please see below my 2 patches.

Vincent

============= patching hw/vnc/kbdptr.c =========
--- kbdptr.c.orig Wed Feb  7 10:29:57 2001
+++ kbdptr.c Fri Feb  9 14:56:53 2001
@@ -79,10 +79,13 @@
     XK_Alt_R,  NoSymbol,
 #define ALT_R_KEY_CODE  (MIN_KEY_CODE + 7)

-    /* Standard US keyboard */

     XK_space,  NoSymbol,
-    XK_0,  XK_parenright,
+
+#ifdef NEW_US_KBD
+    /* Standard US keyboard */
+
+    XK_grave,  XK_asciitilde,
     XK_1,  XK_exclam,
     XK_2,  XK_at,
     XK_3,  XK_numbersign,
@@ -92,6 +95,7 @@
     XK_7,  XK_ampersand,
     XK_8,  XK_asterisk,
     XK_9,  XK_parenleft,
+    XK_0,  XK_parenright,

     XK_minus,  XK_underscore,
     XK_equal,  XK_plus,
@@ -99,11 +103,85 @@
     XK_bracketright, XK_braceright,
     XK_semicolon, XK_colon,
     XK_apostrophe, XK_quotedbl,
-    XK_grave,  XK_asciitilde,
     XK_comma,  XK_less,
     XK_period,  XK_greater,
     XK_slash,  XK_question,
     XK_backslash, XK_bar,
+#endif
+
+#ifdef NEW_UK_KBD
+    /* UK keyboard */
+
+    XK_grave,  XK_notsign,
+    XK_1,  XK_exclam,
+    XK_2,  XK_quotedbl,
+    XK_3,  XK_sterling,
+    XK_4,  XK_dollar,
+    XK_5,  XK_percent,
+    XK_6,  XK_asciicircum,
+    XK_7,  XK_ampersand,
+    XK_8,  XK_asterisk,
+    XK_9,  XK_parenleft,
+    XK_0,  XK_parenright,
+
+    XK_minus,  XK_underscore,
+    XK_equal,  XK_plus,
+
+    XK_bracketleft, XK_braceleft,
+    XK_bracketright, XK_braceright,
+
+    XK_semicolon, XK_colon,
+    XK_apostrophe, XK_at,
+    XK_comma,  XK_less,
+    XK_period,  XK_greater,
+    XK_slash,  XK_question,
+    XK_backslash, XK_bar,
+    XK_numbersign, XK_asciitilde,
+#endif
+
+#ifdef NEW_FR_KBD
+    /* French Keyboard */
+
+    XK_twosuperior, NoSymbol,
+    XK_ampersand, XK_1,
+    XK_eacute,   XK_2,
+    XK_quotedbl, XK_3,
+    XK_apostrophe, XK_4,
+    XK_parenleft, XK_5,
+    XK_minus,  XK_6,
+    XK_egrave,  XK_7,
+    XK_underscore, XK_8,
+    XK_ccedilla, XK_9,
+    XK_agrave,  XK_0,
+    XK_parenright, XK_degree,
+    XK_equal,  XK_plus,
+
+    XK_dead_circumflex, XK_diaeresis,
+    XK_dollar,  XK_sterling,
+
+    XK_ugrave,  XK_percent,
+    XK_asterisk, XK_mu,
+
+    XK_less,  XK_greater,
+    XK_comma,  XK_question,
+    XK_semicolon, XK_period,
+    XK_colon,  XK_slash,
+    XK_exclam,  XK_section,
+
+/* special symbol accessed by AltGr */
+    XK_asciitilde, NoSymbol,
+    XK_numbersign, NoSymbol,
+    XK_braceleft, NoSymbol,
+    XK_bracketleft, NoSymbol,
+    XK_bar,  NoSymbol,
+    XK_grave,  NoSymbol,
+    XK_backslash, NoSymbol,
+    XK_asciicircum, NoSymbol,
+    XK_at,  NoSymbol,
+    XK_bracketright, NoSymbol,
+    XK_braceright, NoSymbol,
+    XK_currency, NoSymbol,
+#endif

     XK_a,  XK_A,
     XK_b,  XK_B,
@@ -162,6 +240,37 @@
     XK_F11,  NoSymbol,
     XK_F12,  NoSymbol,

+/* Num Pad */
+
+    XK_Num_Lock, NoSymbol,
+    XK_KP_Divide, NoSymbol,
+    XK_KP_Multiply, NoSymbol,
+    XK_KP_Subtract, NoSymbol,
+    XK_KP_Home,  NoSymbol,
+    XK_KP_Up,  NoSymbol,
+    XK_KP_Page_Up, NoSymbol,
+    XK_KP_Add,  NoSymbol,
+    XK_KP_Left,  NoSymbol,
+    XK_KP_Begin, NoSymbol,
+    XK_KP_Right, NoSymbol,
+    XK_KP_End,  NoSymbol,
+    XK_KP_Down,  NoSymbol,
+    XK_KP_Page_Down, NoSymbol,
+    XK_KP_Enter, NoSymbol,
+    XK_KP_Insert, NoSymbol,
+    XK_KP_Delete, NoSymbol,
+    XK_KP_7,  NoSymbol,
+    XK_KP_8,  NoSymbol,
+    XK_KP_9,  NoSymbol,
+    XK_KP_4,  NoSymbol,
+    XK_KP_5,  NoSymbol,
+    XK_KP_6,  NoSymbol,
+    XK_KP_1,  NoSymbol,
+    XK_KP_2,  NoSymbol,
+    XK_KP_3,  NoSymbol,
+    XK_KP_0,  NoSymbol,
+    XK_KP_Decimal, NoSymbol,
+
     /* Plus blank ones which can be filled in using xmodmap */

 };


============= patching hw/vnc/init.c =========

--- init.c.orig Thu Feb  8 17:29:47 2001
+++ init.c Thu Feb  8 17:31:19 2001
@@ -858,6 +858,18 @@
          "instead)\n");
     ErrorF("-localhost             only allow connections from
localhost\n");
     ErrorF("-inetd                 Xvnc is launched by inetd\n");
+#if defined (NEW_US_KBD) || defined (NEW_UK_KBD) || defined (NEW_FR_KBD)
+    ErrorF("\nNote: embedded keyboard mapping: ");
+#if defined (NEW_US_KBD)
+    ErrorF("US\n");
+#endif
+#if defined (NEW_UK_KBD)
+    ErrorF("UK\n");
+#endif
+#if defined (NEW_FR_KBD)
+    ErrorF("FR\n");
+#endif
+#endif
     exit(1);
 }
---------------------------------------------------------------------
To unsubscribe, send a message with the line: unsubscribe vnc-list
to [EMAIL PROTECTED]
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------

Reply via email to