提交 eb2e259d 编写于 作者: A Anthony Liguori

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: NAnthony Liguori <aliguori@us.ibm.com>
上级 6fef28ee
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册