qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Keysymbol interpretation missing in QEMU's VNC server?
@ 2012-03-07 10:53 Fabian Holler
  2012-03-08 20:24 ` Philipp Hahn
  2012-03-08 21:30 ` Anthony Liguori
  0 siblings, 2 replies; 10+ messages in thread
From: Fabian Holler @ 2012-03-07 10:53 UTC (permalink / raw)
  To: qemu-devel

Hello,

I'm not sure if I found a bug in QEMU's VNC keyboard layout mapping or
if it's a general problem in the implemented VNC server:

Scenario:
QEMU started with: "-k de"
Keyboard layout in VM: de
Keyboard layout from Client OS: us

What i expect:
I type the '/' character on the Client OS (key left from the right-shift-key) on US layout.
Keysymbol '/' is send over VNC to the QEMU.
QEMU lookup in the de keyboard mapping table for the character '/' and
should find the scancodes for the keys shift+'7'.
The Scancodes for shift and '7' are send to the VM's emulated keyboard
controller and the '/' appears in the VM.

But what actually happens is that the '7' character shows up in the VM.
It seems that QEMU misses to also generate the Shift Scancode.

Is this a general problem in the VNC server implementation?
So that an interpretation (http://tools.ietf.org/html/rfc6143#section-7.5.4)
of the received keysymbols to add eg an additional shift keypress
never happens?

If yes would a QEMU patch that adds keysymbol interpretation have a
chance to be merged in the upstream version?
Or are there reasons that it isn't a good idea to interpret the
keysymbols for the scancode conversion?


regards

Fabian

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [Qemu-devel] Keysymbol interpretation missing in QEMU's VNC server?
@ 2012-03-07 12:22 Fabian Holler
  0 siblings, 0 replies; 10+ messages in thread
From: Fabian Holler @ 2012-03-07 12:22 UTC (permalink / raw)
  To: qemu-devel

Hello,

I'm not sure if I found a bug in QEMU's VNC keyboard layout mapping or
if it's a general problem in the implemented VNC server:

Scenario:
QEMU started with: "-k de"
Keyboard layout in VM: de
Keyboard layout from Client OS: us

What i expect:
I type the '/' character on the Client OS (key left from the right-shift-key) on US layout.
Keysymbol '/' is send over VNC to the QEMU.
QEMU lookup in the de keyboard mapping table for the character '/' and
should find the scancodes for the keys shift+'7'.
The Scancodes for shift and '7' are send to the VM's emulated keyboard
controller and the '/' appears in the VM.

But what actually happens is that the '7' character shows up in the VM.
It seems that QEMU misses to also generate the Shift Scancode.

Is this a general problem in the VNC server implementation?
So that an interpretation (http://tools.ietf.org/html/rfc6143#section-7.5.4)
of the received keysymbols to add eg an additional shift keypress
never happens?

If yes, would a QEMU patch that adds keysymbol interpretation have a
chance to be merged into upstream?
Or are there reasons that it isn't a good idea to interpret the
keysymbols for the scancode conversion?


regards

Fabian

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [Qemu-devel] Keysymbol interpretation missing in QEMU's VNC server?
@ 2014-01-14  8:45 Gonglei (Arei)
  0 siblings, 0 replies; 10+ messages in thread
From: Gonglei (Arei) @ 2014-01-14  8:45 UTC (permalink / raw)
  To: erik.rull@rdsoftware.de, Anthony Liguori, Gerd Hoffmann
  Cc: Luonengjun, qemu-devel@nongnu.org, Huangweidong (Hardware)

Hi,

> Just a small addition: The AltGr Keys are not routed correctly through VNC!
> I had a look at the "de" keymap, it looks as if they are described (e.g.
> backslash \) which is placed on the german keyboard on the key right to the
> 0 key (german key ssharp) and accessed via AltGr + this key. Same with }
> which is at the 0 key position accessed via AltGr + 0. The shifted keys and
> the Windows standard functions Ctrl + C / Ctrl + V works as well.
> They are not lost completely but the AltGr press gets lost! So when
> pressing AltGr + 0, I get only a 0 on the guest instead of a "}".
> 
> Any ideas?

By googled, I found the topic. and I encountered the same probleam.
I am convinced that the AltGr key conflicted with the QEMU console switch.
On the German keyboard, the AltGr as same with Ctrl + Alt on the US keyborad.
Same as you said, the { accessed via AltGr + 7. But at present, the Ctrl + Alt + 1..9
are reserved as QEMU console switch. When we push down the AltGr + 7,
do_key_event function will reset key and enter console_select for AltGr (Ctrl + Alt), 
and finally we get the last key "7" instead of a "{".

the Qemu code(qemu/ui/vnc.c):
static void do_key_event(VncState *vs, int down, int keycode, int sym)
{
    /* QEMU console switch */
    switch(keycode) {
    case 0x2a:                          /* Left Shift */
    case 0x36:                          /* Right Shift */
    case 0x1d:                          /* Left CTRL */
    case 0x9d:                          /* Right CTRL */
    case 0x38:                          /* Left ALT */
    case 0xb8:                          /* Right ALT */
        if (down)
            vs->modifiers_state[keycode] = 1;
        else
            vs->modifiers_state[keycode] = 0;
        break;
    case 0x02 ... 0x0a: /* '1' to '9' keys */
        if (down && vs->modifiers_state[0x1d] && vs->modifiers_state[0x38]) {
            /* Reset the modifiers sent to the current console */
            reset_keys(vs);
            console_select(keycode - 0x02);
            return;
        }
        break;
    ... ...
}

Best regards,
-Gonglei



^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [Qemu-devel] Keysymbol interpretation missing in QEMU's VNC server?
@ 2014-01-25  5:13 Gonglei (Arei)
  0 siblings, 0 replies; 10+ messages in thread
From: Gonglei (Arei) @ 2014-01-25  5:13 UTC (permalink / raw)
  To: aliguori@amazon.com
  Cc: erik.rull@rdsoftware.de, Luonengjun, qemu-devel@nongnu.org,
	Gonglei (Arei), Gerd Hoffmann, Huangweidong (Hardware)

Hi,
Would you give me some advice. Thanks!

I thank we can only need reserve four Qemu console,
Ctrl +1 for graphic show, Ctrl+2 for monitor console,
Ctrl + 3 for serial, Ctrl+4 for parallel. And then will not conflict with "de" keymay.

Best regards,
-Gonglei


> -----Original Message-----
> From: Gonglei (Arei)
> Sent: Tuesday, January 14, 2014 4:45 PM
> To: 'erik.rull@rdsoftware.de'; 'Anthony Liguori'; 'Gerd Hoffmann'
> Cc: Luonengjun; Huangweidong (Hardware); qemu-devel@nongnu.org
> Subject: Re: [Qemu-devel] Keysymbol interpretation missing in QEMU's VNC
> server?
> 
> Hi,
> 
> > Just a small addition: The AltGr Keys are not routed correctly through VNC!
> > I had a look at the "de" keymap, it looks as if they are described (e.g.
> > backslash \) which is placed on the german keyboard on the key right to the
> > 0 key (german key ssharp) and accessed via AltGr + this key. Same with }
> > which is at the 0 key position accessed via AltGr + 0. The shifted keys and
> > the Windows standard functions Ctrl + C / Ctrl + V works as well.
> > They are not lost completely but the AltGr press gets lost! So when
> > pressing AltGr + 0, I get only a 0 on the guest instead of a "}".
> >
> > Any ideas?
> 
> By googled, I found the topic. and I encountered the same probleam.
> I am convinced that the AltGr key conflicted with the QEMU console switch.
> On the German keyboard, the AltGr as same with Ctrl + Alt on the US keyborad.
> Same as you said, the { accessed via AltGr + 7. But at present, the Ctrl + Alt +
> 1..9
> are reserved as QEMU console switch. When we push down the AltGr + 7,
> do_key_event function will reset key and enter console_select for AltGr (Ctrl +
> Alt),
> and finally we get the last key "7" instead of a "{".
> 
> the Qemu code(qemu/ui/vnc.c):
> static void do_key_event(VncState *vs, int down, int keycode, int sym)
> {
>     /* QEMU console switch */
>     switch(keycode) {
>     case 0x2a:                          /* Left Shift */
>     case 0x36:                          /* Right Shift */
>     case 0x1d:                          /* Left CTRL */
>     case 0x9d:                          /* Right CTRL */
>     case 0x38:                          /* Left ALT */
>     case 0xb8:                          /* Right ALT */
>         if (down)
>             vs->modifiers_state[keycode] = 1;
>         else
>             vs->modifiers_state[keycode] = 0;
>         break;
>     case 0x02 ... 0x0a: /* '1' to '9' keys */
>         if (down && vs->modifiers_state[0x1d] && vs->modifiers_state[0x38])
> {
>             /* Reset the modifiers sent to the current console */
>             reset_keys(vs);
>             console_select(keycode - 0x02);
>             return;
>         }
>         break;
>     ... ...
> }
> 
> Best regards,
> -Gonglei
> 


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

end of thread, other threads:[~2014-01-25  5:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-07 10:53 [Qemu-devel] Keysymbol interpretation missing in QEMU's VNC server? Fabian Holler
2012-03-08 20:24 ` Philipp Hahn
2012-03-08 21:23   ` Fabian Holler
2012-03-08 21:30 ` Anthony Liguori
2012-03-08 22:01   ` Fabian Holler
2012-05-23  8:16     ` Erik Rull
2012-05-23  8:45       ` Erik Rull
  -- strict thread matches above, loose matches on Subject: below --
2012-03-07 12:22 Fabian Holler
2014-01-14  8:45 Gonglei (Arei)
2014-01-25  5:13 Gonglei (Arei)

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).