summaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2010-03-09 14:26:40 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2010-03-19 15:27:38 -0500
commit2a56b553ad972d323e3866b351d33072ff0ea49b (patch)
tree7fdf802c2a6078812dcf0146f32db700ec55b490 /input.c
parent53cc17a044553a1fd1cf90a3cb3801be3853ddb4 (diff)
downloadqemu-2a56b553ad972d323e3866b351d33072ff0ea49b.tar.gz
qemu-2a56b553ad972d323e3866b351d33072ff0ea49b.tar.bz2
qemu-2a56b553ad972d323e3866b351d33072ff0ea49b.zip
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>
Diffstat (limited to 'input.c')
-rw-r--r--input.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/input.c b/input.c
index 397bfc5396..8d5a14d2da 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;