qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Keysymbol interpretation missing in QEMU's VNC server?


From: Gonglei (Arei)
Subject: Re: [Qemu-devel] Keysymbol interpretation missing in QEMU's VNC server?
Date: Tue, 14 Jan 2014 08:45:22 +0000

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]