From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrhb8-00075S-4t for qemu-devel@nongnu.org; Mon, 11 May 2015 02:53:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrhb3-0002XR-A2 for qemu-devel@nongnu.org; Mon, 11 May 2015 02:53:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrhb3-0002XC-1v for qemu-devel@nongnu.org; Mon, 11 May 2015 02:53:49 -0400 Message-ID: <1431327220.9620.13.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Mon, 11 May 2015 08:53:40 +0200 In-Reply-To: References: <9D0D12D4-476B-4EF4-80EB-0A61F0BED115@gmail.com> <55031EF5.3070608@redhat.com> <20150316134806.GN10189@redhat.com> <0621CF25-1F49-4BC8-AA1E-D019051C130D@gmail.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Programmingkid , qemu-devel qemu-devel , Paolo Bonzini On So, 2015-05-10 at 23:51 +0100, Peter Maydell wrote: > On 10 May 2015 at 23:34, Peter Maydell wrote: > > I've now tested again with my not-just-the-laptop setup, and: > > > > * in the guest OS (I tested with a Linux guest), PageUp/Down > > work OK and work the same whether I use an external USB > > keyboard with a physical PgUp/Down key or the MacBook Air's > > keyboard with Fn+UpArrow/Fn+DownArrow as the chord to > > input pageup/down > > * in the monitor window, neither way of inputting PageUp/Down > > works: all you get is a ',' input into the monitor > > > > So my conclusion is that we should fix the underlying > > problem that the monitor isn't handling PgUp/PgDown > > correctly (not sure exactly why that's not working yet). > > So looking at the code in ui/console.c that implements our > virtual consoles, the scrolling is hooked up to the keycodes > QEMU_KEY_CTRL_{UP,DOWN,PAGEUP,PAGEDOWN}. These only seem > to be output by one of our UI frontends, SDL. > > Gerd, how is this supposed to work? Shouldn't something > in the generic console code be handling converting the > Q_KEY_CODE_CTRL/CTRL_R + Q_KEY_CODE_PGUP/DOWN/etc into > what the vc layer expects, rather than having each of the > ui frontends doing it? Unfortunaly it isn't that easy as we have two very different modes of operation here: For vc's we need the keyboard input already mapped to your local keyboard layout (i.e. the keysyms). For guest input we need the raw scancodes of the keys as the keyboard layout handling is done by the guest. The differences between the UIs (especially when it comes to raw scancodes) are big enough that it is next to impossible to hide all that in common code. Specifically for the vc control keys there is a little helper function though: kbd_put_qcode_console(), used by sdl2 and gtk, which might be useful for cocoa too. cheers, Gerd