Commit Graph

6 Commits

Author SHA1 Message Date
Anthony Liguori 1aaee43cf7 Expose whether a mouse is an absolute device via QMP and the human monitor.
For QMP, we just add an attribute which is backwards compatible.  For the human
monitor, we add (absolute) to the end of the line.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19 15:27:38 -05:00
Anthony Liguori 7e581fb3b1 Add notifier for mouse mode changes
Right now, DisplayState clients rely on polling the mouse mode to determine
when the device is changed to an absolute device.  Use a notification list to
add an explicit notification.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19 15:27:38 -05:00
Anthony Liguori eb2e259d95 Add kbd_mouse_has_absolute()
kbd_mouse_is_absolute tells us whether the current mouse handler is an absolute
device.  kbd_mouse_has_absolute tells us whether we have any device that is
capable of absolute input.

This lets us tell a user that they have configured an absolute device but that
the guest is not currently using it.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19 15:27:38 -05:00
Anthony Liguori 6fef28ee6e Rewrite mouse handlers to use QTAILQ and to have an activation function
And convert usb-hid to use it (to avoid regression with bisection)

Right now, when we do info mice and we've added a usb tablet, we don't see it
until the guest starts using the tablet.  We implement this behavior in order
to provide a means to delay registration of a mouse handler since we treat
the last registered handler as the current handler.

This is a usability problem though as we would like to give the user feedback
that they've either 1) not added an absolute device 2) there is an absolute
device but the guest isn't using it 3) we have an absolute device and it's
active.

By using QTAILQ and having an explicit activation function that moves the
handler to the front of the queue, we can implement the same semantics as
before with respect to automatically switching to usb tablet while providing
the user with a whole lot more information.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19 15:27:38 -05:00
Gerd Hoffmann 03a23a85f4 kbd leds: infrastructure
Adds infrastructure for keyboard led status tracking to qemu.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-09 08:47:20 -06:00
Paolo Bonzini 8f0056b763 move kbd/mouse handling to input.c
Move 200 lines out of vl.c already into common code that only needs to
be compiled once.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-13 17:14:14 -06:00