All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: Ben Hekster <ben.hekster@foghorn.io>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Booting Raspbian on RPi emulation
Date: Mon, 28 Jan 2019 10:24:00 +0000	[thread overview]
Message-ID: <CAFEAcA-9rbjin-k-bxq=UZ_j4N2rADJ4=NWB7D9ogB1K_=7Zdw@mail.gmail.com> (raw)
In-Reply-To: <alpine.BSF.2.21.9999.1901272321030.63988@zero.eik.bme.hu>

On Sun, 27 Jan 2019 at 23:13, BALATON Zoltan <balaton@eik.bme.hu> wrote:
> On Sun, 27 Jan 2019, Peter Maydell wrote:
> > Unfortunately I'm not sufficiently familiar with how OSX
> > event handling works to figure out how to plumb it back in
> > again. It ought to be a fairly simple matter of "implement
> > whatever method OSX sends events to on whatever of our
> > various classes is the right one, and make it call handleEvent
> > with the NSEvent", but I've tried a few things and haven't
> > been able to actually get any event handling methods to
> > fire at all :-(
>
> I think you need to implement keyDown: and keyUp: methods in QemuCocoaView
> to get keyboard events and there are similar methods for mouse events,
> see:
>
> https://developer.apple.com/documentation/appkit/nsview?language=objc

Yeah, I got something working later last night. You also need
to implement acceptsFirstResponder or you don't get any events.
So I have something that at least works for key events in the
monitor window now. I need to check whether we do the right
thing for things like cmd-key hotkeys which need to be handled
by the stock OSX event handling. (In the old scheme we deal with
these by having handleEvent pass them on to sendEvent, but in
the new setup that's an infinite recursion.)

> But these are a lot of methods which are supposedly called from the
> sendEvent: method of the NSWindow containing this view so maybe a better
> place to catch all events is there. For this we need an NSWindow subclass
> implementing sendEvent: which is then used to hold QemuCocoaView. I may be
> wrong though, haven't tested it and don't know what you've tried.

Yeah, we could also do something like that, or another approach
I found by searching around is to use addLocalMonitorForEventsMatchingMask
to catch events. I'd kind of prefer to do whatever is the "expected"
setup for OSX apps, though, and I get the impression that completely
overriding sendEvent is a bit outside the normal path.

thanks
-- PMM

  reply	other threads:[~2019-01-28 10:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 21:53 [Qemu-devel] Booting Raspbian on RPi emulation Ben Hekster
2018-12-18 22:34 ` BALATON Zoltan
2018-12-19 13:17 ` Peter Maydell
2018-12-19 17:46   ` Ben Hekster
2018-12-19 18:43     ` Peter Maydell
2018-12-19 19:36       ` Ben Hekster
2018-12-19 19:42         ` Ben Hekster
2018-12-20  2:14           ` BALATON Zoltan
2019-01-27 19:27           ` Peter Maydell
2019-01-27 23:13             ` BALATON Zoltan
2019-01-28 10:24               ` Peter Maydell [this message]
2019-01-28 15:30                 ` BALATON Zoltan
  -- strict thread matches above, loose matches on Subject: below --
2018-11-29 20:29 BALATON Zoltan
2018-11-30  0:43 ` Philippe Mathieu-Daudé
2018-11-30  1:27   ` Guenter Roeck
2018-11-30  2:42     ` BALATON Zoltan
2018-11-30  3:39       ` Guenter Roeck
2018-11-30 12:36         ` BALATON Zoltan
2019-01-15 18:29 ` BALATON Zoltan
2019-01-15 18:54   ` Philippe Mathieu-Daudé
2019-03-04 17:58     ` BALATON Zoltan
2019-08-20 14:50     ` BALATON Zoltan
2019-08-20 15:14       ` Philippe Mathieu-Daudé

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='CAFEAcA-9rbjin-k-bxq=UZ_j4N2rADJ4=NWB7D9ogB1K_=7Zdw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=balaton@eik.bme.hu \
    --cc=ben.hekster@foghorn.io \
    --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.