qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] vnc with german keymap
@ 2007-07-04  0:24 Juergen Lock
  2007-07-04  8:09 ` Eduardo Felipe
  0 siblings, 1 reply; 5+ messages in thread
From: Juergen Lock @ 2007-07-04  0:24 UTC (permalink / raw)
  To: qemu-devel

Hi!

 I got a report yesterday of -vnc not working right with german
keymaps (I hadn't really played with -vnc yet so I hadn't noticed),
and came up with the following hack: (which still needs -k de,
that just wasn't enough)

Index: qemu/vnc.c
@@ -763,7 +763,31 @@
 {
     int keycode;
 
+#if 1
+    /* XXX fixup some de keysyms (use with -k de) */
+    if ((sym & 0xffff) == 0xfe03)    /* Alt_Gr -> Alt_R */
+	sym = 0xffea;
+    if ((sym & 0xffff) == 0xfe50)    /* grave */
+	sym = '`';
+#if 0
+    if ((sym & 0xffff) == 0xfe51)    /* '/acute (gets mixed up with #) */
+	sym = '\'';
+#endif
+    if ((sym & 0xffff) == 0xfe52)    /* asciicircum */
+	sym = '^';
+    if ((sym & 0xffff) == 0xfe53)    /* asciitilde */
+	sym = '~';
+#endif
     keycode = keysym2scancode(vs->kbd_layout, sym & 0xFFFF);
+#if 1
+    /* '/acute key needs special treatment */
+    if (!keycode && (sym & 0xffff) == 0xfe51)    /* acute */
+	keycode = 0xd;
+#endif
+#ifdef VNCDEBUGKEYS
+    printf("do_key_event down %d, sym 0x%x, keycode 0x%x\n",
+	down, (int) sym, keycode);
+#endif
     
     /* QEMU console switch */
     switch(keycode) {

 I wasn't able to fix this by editing vnc_keysym.h and/or keymaps
because those dont take duplicate definitions, but this is certainly
`somewhat' ugly; anyone care to fix it for real? :)

 Thanx,
	Juergen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] vnc with german keymap
  2007-07-04  0:24 [Qemu-devel] vnc with german keymap Juergen Lock
@ 2007-07-04  8:09 ` Eduardo Felipe
  2007-07-04 19:48   ` Juergen Lock
  0 siblings, 1 reply; 5+ messages in thread
From: Eduardo Felipe @ 2007-07-04  8:09 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1793 bytes --]

Hi,

Some time ago I made a patch to handle keyboard localization for vnc:

http://lists.gnu.org/archive/html/qemu-devel/2006-08/msg00129.html

It is outdated and most probably won't apply to current CVS, but with some
tweaking it can improve things a bit.

Regads,
Eduardo Felipe


2007/7/4, Juergen Lock <nox@jelal.kn-bremen.de>:
>
> Hi!
>
> I got a report yesterday of -vnc not working right with german
> keymaps (I hadn't really played with -vnc yet so I hadn't noticed),
> and came up with the following hack: (which still needs -k de,
> that just wasn't enough)
>
> Index: qemu/vnc.c
> @@ -763,7 +763,31 @@
> {
>      int keycode;
>
> +#if 1
> +    /* XXX fixup some de keysyms (use with -k de) */
> +    if ((sym & 0xffff) == 0xfe03)    /* Alt_Gr -> Alt_R */
> +       sym = 0xffea;
> +    if ((sym & 0xffff) == 0xfe50)    /* grave */
> +       sym = '`';
> +#if 0
> +    if ((sym & 0xffff) == 0xfe51)    /* '/acute (gets mixed up with #) */
> +       sym = '\'';
> +#endif
> +    if ((sym & 0xffff) == 0xfe52)    /* asciicircum */
> +       sym = '^';
> +    if ((sym & 0xffff) == 0xfe53)    /* asciitilde */
> +       sym = '~';
> +#endif
>      keycode = keysym2scancode(vs->kbd_layout, sym & 0xFFFF);
> +#if 1
> +    /* '/acute key needs special treatment */
> +    if (!keycode && (sym & 0xffff) == 0xfe51)    /* acute */
> +       keycode = 0xd;
> +#endif
> +#ifdef VNCDEBUGKEYS
> +    printf("do_key_event down %d, sym 0x%x, keycode 0x%x\n",
> +       down, (int) sym, keycode);
> +#endif
>
>      /* QEMU console switch */
>      switch(keycode) {
>
> I wasn't able to fix this by editing vnc_keysym.h and/or keymaps
> because those dont take duplicate definitions, but this is certainly
> `somewhat' ugly; anyone care to fix it for real? :)
>
> Thanx,
>         Juergen
>
>
>

[-- Attachment #2: Type: text/html, Size: 2966 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] vnc with german keymap
  2007-07-04  8:09 ` Eduardo Felipe
@ 2007-07-04 19:48   ` Juergen Lock
  2007-07-05  9:44     ` Eduardo Felipe
       [not found]     ` <83a4d4ca0707050142m3cd2fb93w30c3dbe61d33c610@mail.gmail.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Juergen Lock @ 2007-07-04 19:48 UTC (permalink / raw)
  To: edusaper; +Cc: qemu-devel

In article <83a4d4ca0707040109o242dc1f9s7e5c8c046baf2f6a@mail.gmail.com> you write:
>-=-=-=-=-=-
>
>Hi,
>
>Some time ago I made a patch to handle keyboard localization for vnc:
>
>http://lists.gnu.org/archive/html/qemu-devel/2006-08/msg00129.html
>
>It is outdated and most probably won't apply to current CVS, but with some
>tweaking it can improve things a bit.

Ah, thanx, I didnt see that one! :)

 I have a qeuestion tho: does this patch do deadkey handling on the host?
Because I didn't have to do anything like that for the de patch, the
guest could do that itself just fine.  (tested with a linux livecd
guest with (under X) and without deadkeys (console).)

 bye,
	Juergen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] vnc with german keymap
  2007-07-04 19:48   ` Juergen Lock
@ 2007-07-05  9:44     ` Eduardo Felipe
       [not found]     ` <83a4d4ca0707050142m3cd2fb93w30c3dbe61d33c610@mail.gmail.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Eduardo Felipe @ 2007-07-05  9:44 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 993 bytes --]

2007/7/4, Juergen Lock <nox@jelal.kn-bremen.de>:
>
>
> Ah, thanx, I didnt see that one! :)
>
> I have a qeuestion tho: does this patch do deadkey handling on the host?


Yes. IIRC I needed that because some VNC clients I tested didn't send dead
keys to the server. They just waited for a full character to be available in
its buffer to send the KeyEvent message, as they assume the server will know
how to represent it. That is, if I press ´ and o in some VNC clients, only
an ó (0x00f3) message is sent after pressing the last key, not the 0xfe51 /
0x006f combination. The server (qemu) has to know how to build the character
for its guest.

Because I didn't have to do anything like that for the de patch, the
> guest could do that itself just fine.  (tested with a linux livecd
> guest with (under X) and without deadkeys (console).)
>
>
Your VNC client probably sends deadkey messages... or maybe I have a
complicated way to handle simple things :)

Regards,
Edu

[-- Attachment #2: Type: text/html, Size: 1563 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] vnc with german keymap
       [not found]       ` <20070706170805.GA7833@saturn.kn-bremen.de>
@ 2007-07-07 15:44         ` Eduardo Felipe
  0 siblings, 0 replies; 5+ messages in thread
From: Eduardo Felipe @ 2007-07-07 15:44 UTC (permalink / raw)
  To: Juergen Lock; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 655 bytes --]

2007/7/6, Juergen Lock <nox@jelal.kn-bremen.de>:
>
> On Thu, Jul 05, 2007 at 10:42:03AM +0200, Eduardo Felipe wrote:
>
> > Your VNC client probably sends deadkey messages... or maybe I have a
> > complicated way to handle simple things :)
>
> Yup, I tested with tightvnc-1.3.8.


I've tried tightvnc and it does send deadkey messages. By contrast, RealVNC
is an example of client that sends extended Latin-1 (or similar) characters.

(You might want to explain this fact on the list tho, it may have been
> the reason your patch wasn't committed...)
>
> Bye,
>         Juergen
>

Agreed, cc'ing. I just forgot to "Reply-to-all" last time...

Regards,
Edu

[-- Attachment #2: Type: text/html, Size: 1150 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-07 15:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-04  0:24 [Qemu-devel] vnc with german keymap Juergen Lock
2007-07-04  8:09 ` Eduardo Felipe
2007-07-04 19:48   ` Juergen Lock
2007-07-05  9:44     ` Eduardo Felipe
     [not found]     ` <83a4d4ca0707050142m3cd2fb93w30c3dbe61d33c610@mail.gmail.com>
     [not found]       ` <20070706170805.GA7833@saturn.kn-bremen.de>
2007-07-07 15:44         ` Eduardo Felipe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).