[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/7] Add kbd_mouse_has_absolute()
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 3/7] Add kbd_mouse_has_absolute() |
Date: |
Wed, 10 Mar 2010 10:51:05 -0600 |
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 <address@hidden>
---
console.h | 5 +++++
input.c | 13 +++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/console.h b/console.h
index 94d9cae..f3c619f 100644
--- a/console.h
+++ b/console.h
@@ -53,8 +53,13 @@ void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry);
void kbd_put_keycode(int keycode);
void kbd_put_ledstate(int ledstate);
void kbd_mouse_event(int dx, int dy, int dz, int buttons_state);
+
+/* Does the current mouse generate absolute events */
int kbd_mouse_is_absolute(void);
+/* Of all the mice, is there one that generates absolute events */
+int kbd_mouse_has_absolute(void);
+
struct MouseTransformInfo {
/* Touchscreen resolution */
int x;
diff --git a/input.c b/input.c
index 397bfc5..8d5a14d 100644
--- a/input.c
+++ b/input.c
@@ -153,6 +153,19 @@ int kbd_mouse_is_absolute(void)
return QTAILQ_FIRST(&mouse_handlers)->qemu_put_mouse_event_absolute;
}
+int kbd_mouse_has_absolute(void)
+{
+ QEMUPutMouseEntry *entry;
+
+ QTAILQ_FOREACH(entry, &mouse_handlers, node) {
+ if (entry->qemu_put_mouse_event_absolute) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
static void info_mice_iter(QObject *data, void *opaque)
{
QDict *mouse;
--
1.6.5.2
- [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists, Anthony Liguori, 2010/03/10
- [Qemu-devel] [PATCH 2/7] Rewrite mouse handlers to use QTAILQ and to have an activation function, Anthony Liguori, 2010/03/10
- [Qemu-devel] [PATCH 5/7] Expose whether a mouse is an absolute device via QMP and the human monitor., Anthony Liguori, 2010/03/10
- [Qemu-devel] [PATCH 3/7] Add kbd_mouse_has_absolute(),
Anthony Liguori <=
- [Qemu-devel] [PATCH 6/7] input: make vnc use mouse mode notifiers, Anthony Liguori, 2010/03/10
- [Qemu-devel] [PATCH 7/7] sdl: use mouse mode notifier, Anthony Liguori, 2010/03/10
- [Qemu-devel] [PATCH 4/7] Add notifier for mouse mode changes, Anthony Liguori, 2010/03/10
- Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists, Paul Brook, 2010/03/11