Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C3I6d-0000wg-DJ for qemu-devel@nongnu.org; Fri, 03 Sep 2004 13:44:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C3I6c-0000vr-BH for qemu-devel@nongnu.org; Fri, 03 Sep 2004 13:44:10 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C3I6c-0000vh-84 for qemu-devel@nongnu.org; Fri, 03 Sep 2004 13:44:10 -0400 Received: from [192.76.135.70] (helo=kurt.tools.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1C3I1U-0003Zv-J6 for qemu-devel@nongnu.org; Fri, 03 Sep 2004 13:38:55 -0400 Received: from tiger2.tools.intra (tiger2.tools.intra [172.20.0.11]) by kurt.tools.de (8.12.11/8.12.11) with ESMTP id i83HcZjh001331 for ; Fri, 3 Sep 2004 19:38:36 +0200 (MEST) Received: from tiger2.tools.intra (tiger2.tools.intra [IPv6:2::20:208:c7ff:feaa:83b8]) by tiger2.tools.intra (8.12.10+Sun/8.12.10) with SMTP id i83HcZLj023692 for ; Fri, 3 Sep 2004 19:38:35 +0200 (CEST) Message-Id: <200409031738.i83HcZLj023692@tiger2.tools.intra> Date: Fri, 3 Sep 2004 19:38:35 +0200 (CEST) From: Juergen Keil Subject: Re: [Qemu-devel] Keyboard problem in qemu 0.6.0-2 MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: mvpFQWB8ee7Lbh9PmiMFLQ== Reply-To: Juergen Keil , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org > 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.