qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
[parent not found: <200409032051.i83KpOLj027201@tiger2.tools.intra>]
* Re: [Qemu-devel] Keyboard problem in qemu 0.6.0-2
@ 2004-09-03 17:38 Juergen Keil
  2004-09-03 20:06 ` Bochnig, Martin
  2004-09-03 20:44 ` Fabrice Bellard
  0 siblings, 2 replies; 19+ messages in thread
From: Juergen Keil @ 2004-09-03 17:38 UTC (permalink / raw)
  To: qemu-devel



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

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

end of thread, other threads:[~2004-09-07 13:33 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <ksadil@bigpond.net.au>
2004-09-04  1:07 ` [Qemu-devel] Keyboard problem in qemu 0.6.0-2 Kim Adil
2004-09-03 11:54   ` Mark Williamson
2004-09-04  2:07     ` Kim Adil
2004-09-03 12:28       ` Mark Williamson
2004-09-04  2:34         ` Kim Adil
2004-09-04  2:38           ` Kim Adil
2004-09-04  4:26             ` Kim Adil
2004-09-03 17:13               ` Bochnig, Martin
2004-09-03 17:33                 ` Bochnig, Martin
2004-09-04  1:53                 ` Kim Adil
2004-09-04  7:18                   ` Bochnig, Martin
2004-09-04  7:55                     ` Bochnig, Martin
     [not found] <200409032051.i83KpOLj027201@tiger2.tools.intra>
2004-09-03 21:11 ` Bochnig, Martin
2004-09-03 17:38 Juergen Keil
2004-09-03 20:06 ` Bochnig, Martin
2004-09-03 20:22   ` Bochnig, Martin
2004-09-03 20:44 ` Fabrice Bellard
2004-09-06 14:16   ` Johannes Schindelin
2004-09-07 13:27   ` Johannes Schindelin

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