From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DwPGO-0006Z6-Cb for qemu-devel@nongnu.org; Sat, 23 Jul 2005 15:02:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DwPGF-0006UV-Vd for qemu-devel@nongnu.org; Sat, 23 Jul 2005 15:02:15 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DwPGF-0006D0-1G for qemu-devel@nongnu.org; Sat, 23 Jul 2005 15:02:11 -0400 Received: from [128.8.10.162] (helo=po0.wam.umd.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DwPB9-00014g-8F for qemu-devel@nongnu.org; Sat, 23 Jul 2005 14:56:55 -0400 Received: from jbrown.mylinuxbox.org (jma-box.student.umd.edu [129.2.237.180]) by po0.wam.umd.edu (8.12.10/8.12.10) with ESMTP id j6NIkM34017843 for ; Sat, 23 Jul 2005 14:46:23 -0400 (EDT) Date: Sat, 23 Jul 2005 14:46:22 -0400 From: "Jim C. Brown" Subject: Re: [Qemu-devel] Re: [PATCH] Fix virtual console switching with SDL on Mac OS X Message-ID: <20050723184622.GA15598@jbrown.mylinuxbox.org> References: <20050722224059.GA18275@jbrown.mylinuxbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Reply-To: 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 On Sat, Jul 23, 2005 at 02:42:12PM +0200, Christian Walther wrote: > >Looks like the bug affects X11 and W32 as well, if you are not using a > >US keymap. > Oops, I meant only X11, as W32 doesnt use qemu's keymaps. Only the X11 SDL driver, and the not-yet-committed X11 GTK driver, use it. > I don't think so. The non-keymap code that was used before my patch > (sdl_keyevent_to_keycode()) uses event.key.keysym.scancode, which is > platform-dependent, but refers to the location of the keys, not their > value under the current keyboard mapping (apparently X keycodes on X11, > PC keycodes on Windows, ADB keycodes on Mac OS). Well, the X keycodes returned actually do change depending on what kind of hardware keyboard you are using. But if eveyone was running SDL under X11 with PC keyboards, then it is possible that no one would have noticed. I'll have to investigate how keycodes and X11 keysyms are handled further. > The with-keymap code > (sdl_keyevent_to_keycode_generic()) on the other hand uses > event.key.keysym.sym (one of the SDLK_xxx constants), which is affected > by the OS's keyboard mapping. Which is converted back into a raw X11 keycode, based on the given keymap file passed via "-k keymap". So for the bug to not affect X11, the keycode in the keymap file and the keycode returned by SDL would have to be the same, or at least map to the same character. Curious. -- Infinite complexity begets infinite beauty. Infinite precision begets infinite perfection.