[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 3/4] ui/input: Add activate/remove for keyboard handlers



Adds missing functions to activate and remove keyboard handlers
* qemu_activate_kbd_event_handler
* qemu_remove_kbd_event_handler

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 include/ui/console.h |  2 ++
 ui/input-legacy.c    | 12 ++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/include/ui/console.h b/include/ui/console.h
index 7262bef..f5045e1 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -55,6 +55,8 @@ typedef struct QEMUPutLEDEntry QEMUPutLEDEntry;
 
 QEMUPutKbdEntry *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func,
                                             void *opaque);
+void qemu_remove_kbd_event_handler(QEMUPutKbdEntry *entry);
+void qemu_activate_kbd_event_handler(QEMUPutKbdEntry *entry);
 QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
                                                 void *opaque, int absolute,
                                                 const char *name);
diff --git a/ui/input-legacy.c b/ui/input-legacy.c
index 7159747..fbe1ce7 100644
--- a/ui/input-legacy.c
+++ b/ui/input-legacy.c
@@ -142,6 +142,18 @@ QEMUPutKbdEntry 
*qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *opaque)
     return entry;
 }
 
+void qemu_activate_kbd_event_handler(QEMUPutKbdEntry *entry)
+{
+    qemu_input_handler_activate(entry->s);
+}
+
+void qemu_remove_kbd_event_handler(QEMUPutKbdEntry *entry)
+{
+    qemu_input_handler_unregister(entry->s);
+
+    g_free(entry);
+}
+
 static void legacy_mouse_event(DeviceState *dev, QemuConsole *src,
                                InputEvent *evt)
 {
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.