From eb2e259d95a67ef0cd8a61c0bd4974559e9bfa5d Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Tue, 9 Mar 2010 14:26:40 -0600 Subject: 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 --- input.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'input.c') 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; -- cgit v1.1