All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Programmingkid <programmingkidx@gmail.com>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
Date: Mon, 11 May 2015 08:53:40 +0200	[thread overview]
Message-ID: <1431327220.9620.13.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <CAFEAcA-nMZcuMFQpZ+Ay-w7eKjjdBAjO0EbVeqzD0ATvhMCwsQ@mail.gmail.com>

On So, 2015-05-10 at 23:51 +0100, Peter Maydell wrote:
> On 10 May 2015 at 23:34, Peter Maydell <peter.maydell@linaro.org> 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

  reply	other threads:[~2015-05-11  6:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13  4:35 [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor Programmingkid
2015-03-13  9:51 ` Peter Maydell
2015-03-13 14:48   ` Programmingkid
2015-03-13 17:31     ` Paolo Bonzini
2015-03-13 20:43       ` Programmingkid
2015-03-16 12:19         ` Paolo Bonzini
2015-03-16 13:35           ` Programmingkid
2015-03-16 13:36             ` Paolo Bonzini
2015-03-16 13:39               ` Programmingkid
2015-03-16 13:48         ` Daniel P. Berrange
2015-03-16 14:00           ` Peter Maydell
2015-03-16 14:38             ` Programmingkid
2015-03-16 14:43               ` Peter Maydell
2015-03-16 14:45                 ` Programmingkid
2015-03-16 14:47                   ` Paolo Bonzini
2015-03-16 14:49                     ` Programmingkid
2015-03-16 14:52                       ` Paolo Bonzini
2015-03-16 14:59                         ` Peter Maydell
2015-03-16 15:06                           ` Programmingkid
2015-03-16 15:01                         ` Programmingkid
2015-05-10 22:34                   ` Peter Maydell
2015-05-10 22:51                     ` Peter Maydell
2015-05-11  6:53                       ` Gerd Hoffmann [this message]
2015-06-11 14:23                         ` Peter Maydell
2015-03-16 14:33           ` Programmingkid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431327220.9620.13.camel@nilsson.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.