From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C3L0G-0002op-3x for qemu-devel@nongnu.org; Fri, 03 Sep 2004 16:49:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C3L0E-0002oV-G0 for qemu-devel@nongnu.org; Fri, 03 Sep 2004 16:49:47 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C3L0E-0002oS-Cb for qemu-devel@nongnu.org; Fri, 03 Sep 2004 16:49:46 -0400 Received: from [129.104.30.34] (helo=a.mx.polytechnique.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C3Kuf-0007mI-Or for qemu-devel@nongnu.org; Fri, 03 Sep 2004 16:44:02 -0400 Message-ID: <4138D7AD.4010208@bellard.org> Date: Fri, 03 Sep 2004 22:44:29 +0200 From: Fabrice Bellard MIME-Version: 1.0 Subject: Re: [Qemu-devel] Keyboard problem in qemu 0.6.0-2 References: <200409031738.i83HcZLj023692@tiger2.tools.intra> In-Reply-To: <200409031738.i83HcZLj023692@tiger2.tools.intra> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juergen Keil , qemu-devel@nongnu.org I'll try to merge parts of the VNC patch to solve the problem (rdesktop keyboard mappings support). Fabrice. Juergen Keil wrote: > >>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. > > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel > >