qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Keyboard problem in qemu 0.6.0-2


From: Juergen Keil
Subject: Re: [Qemu-devel] Keyboard problem in qemu 0.6.0-2
Date: Fri, 3 Sep 2004 19:38:35 +0200 (CEST)


> I have similar problems with a Solaris10_x86 host running QEMU 0.6.0 
> when displaying to the default Xsun X-Server at ':0.0' or forwarding to 
> my SPARC machines running several Solaris versions.
> 
> These problems make QEMU (any Guest OS's command line, any input fields) 
> completely unusable.

Yep, I noticed that problem, too. On a Solaris9_x86 host / Xsun.


The root cause is probably the sdl.c:sdl_keyevent_to_keycode() subroutine
that assumes X11 keycodes can be converted to PC scancodes by substracting
8 from the X11 keycode (for keycodes in the range 8..96):


static uint8_t sdl_keyevent_to_keycode(const SDL_KeyboardEvent *ev)
{
    int keycode;

    keycode = ev->keysym.scancode;

    if (keycode < 9) {
        keycode = 0;
    } else if (keycode < 97) {
        keycode -= 8; /* just an offset */
    } else if (keycode < 158) {
        /* use conversion table */
        keycode = x_keycode_to_pc_keycode[keycode - 97];
    } else {
        keycode = 0;
    }
    return keycode;
}


I guess that (``scancode = keycode - 8'') only works with an XFree86 X11
server.


My current workaround is to compile sdl.c with CONFIG_SDL_GENERIC_KBD
defined.  This enables a more accurate X11 keysym to PC scancode translation
table.   Problem is, the translation table assumes a US keyboard layout.





reply via email to

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