qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC 0/8] monitor: Fix mouse_button and improve m


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH RFC 0/8] monitor: Fix mouse_button and improve mouse_move commands
Date: Mon, 17 Jun 2013 09:16:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130513 Thunderbird/17.0.6

  Hi,

> My solution is to obtain position and buttons state from where the VMState is:
> I clean up the mouse event handler registration code a bit and extend it:
> * one mandatory callback to obtain mouse button state and
> * one optional callback to obtain absolute position state from backends.

Hmm, querying state from the mouse drivers just to be able to pass it
back in is a bit backwards.

I'd rather go fix the event reporting interface.  Instead of having
*one* callback with *all* parameters I think we should have a callback
per parameter, or maybe better a parameter type enum.  i.e. instead of:

  mouse_event(x, y, z, button_state)

We'll have

  mouse_event(type, value)

Then we'll report moves this way:

  mouse_event(REL_X, 23);     // or ABS_X for the tablet.
  mouse_event(REL_Y, 42);
  mouse_event(SYNC, 0);       // <<= means "done, flush events to guest"

And klicks this way:

  mouse_event(DOWN, BTN_LEFT);
  mouse_event(SYNC);

  mouse_event(UP, BTN_LEFT);
  mouse_event(SYNC);

The linux input layer works in a simliar way.

cheers,
  Gerd






reply via email to

[Prev in Thread] Current Thread [Next in Thread]