[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7] ui/cocoa.m: Add ability for user to specify
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH v7] ui/cocoa.m: Add ability for user to specify mouse ungrab key |
Date: |
Tue, 20 Feb 2018 11:08:37 +0100 |
User-agent: |
NeoMutt/20171215 |
> >> case NSEventTypeKeyUp:
> >> keycode = cocoa_keycode_to_qemu([event keyCode]);
> >>
> >> + if (are_sets_equal(ungrab_set, key_set)) {
> >> + [self ungrabMouse];
> >> + clear_set(key_set);
> >> + return;
> >> + }
> >> + send_key_if_delayed(key_set, keycode);
> >> + remove_number(key_set, keycode);
> >
> > This doesn't maintain the event ordering.
>
> I need more clearifiction.
>
> If the ungrab keys are 1-2-3, and the user does this:
> down: 2
> down: 3
> down: 4
>
> The only input that is sent to the guest is the 4. The 2 and 3 are
> forgotten about. You want the 2 and the 3 sent to the guest in the
> order they were pushed?
Yes.
> Is there another condition that needs work.
Well, basically if the key combination pressed isn't a hotkey all key
events should be sent as-is to the guest. No events dropped, no events
reordered.
You can't use a set for this, because you don't know the event order
then. With ungrab key 1-2-3 and this event sequence ...
down: 1
down: 2
up: 2
up: 1
... your send_key_if_delayed() logic sends this to the guest:
down: 2
up: 2
down: 1
up: 1
cheers,
Gerd