From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DwJeS-0004ni-G3 for qemu-devel@nongnu.org; Sat, 23 Jul 2005 09:02:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DwJeP-0004lt-00 for qemu-devel@nongnu.org; Sat, 23 Jul 2005 09:02:45 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DwJeN-0004SR-Lu for qemu-devel@nongnu.org; Sat, 23 Jul 2005 09:02:44 -0400 Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DwJUx-0006WE-3a for qemu-devel@nongnu.org; Sat, 23 Jul 2005 08:52:59 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DwJKl-0007oU-DV for qemu-devel@nongnu.org; Sat, 23 Jul 2005 14:42:27 +0200 Received: from 84-72-15-23.dclient.hispeed.ch ([84.72.15.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Jul 2005 14:42:27 +0200 Received: from cwalther by 84-72-15-23.dclient.hispeed.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Jul 2005 14:42:27 +0200 From: Christian Walther Date: Sat, 23 Jul 2005 14:42:12 +0200 Message-ID: References: <20050722224059.GA18275@jbrown.mylinuxbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <20050722224059.GA18275@jbrown.mylinuxbox.org> Sender: news Subject: [Qemu-devel] Re: [PATCH] Fix virtual console switching with SDL on Mac OS X 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 Jim C. Brown wrote: > On Fri, Jul 22, 2005 at 11:24:21PM +0200, Christian Walther wrote: > >>Has switching virtual consoles actually been broken with SDL on non-X11, >>non-win32 platforms (i.e. Mac OS X) for 7 months without anyone noticing >>?? Anyway, here's a patch that fixes it. Just a small change that was >>forgotten in the keymaps support (sdl.c rev. 1.20). Applies to current >>CVS as well as 0.7.0. >> >> -Christian > > > Interesting. > > Looks like the bug affects X11 and W32 as well, if you are not using a > US keymap. 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). 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. (Although IMHO it shouldn't be, but when that topic was brought up on the SDL mailing list, the answer IIRC was that that would be too difficult to fix on all platforms supported by SDL. I'm not convinced by that, but I didn't investigate any further at that time.) It's just that in sdl_keyevent_to_keycode, the X11 and win32 cases are handled, but not the Mac OS case. -Christian