diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-01-05 16:42:13 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-01-05 16:42:13 +0000 |
commit | 455204eb1a0880a5e4474acf07d4641f51123a1d (patch) | |
tree | bfd45c2e35a33fe1289de48263177e111ff4ee7d /hw | |
parent | 6f30fa853b78203c3a03c91470b7d2d12f46955a (diff) |
Dynamic handling of guest mice, by Lonnie Mendez.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2290 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/adb.c | 2 | ||||
-rw-r--r-- | hw/ps2.c | 2 | ||||
-rw-r--r-- | hw/slavio_serial.c | 2 | ||||
-rw-r--r-- | hw/usb-hid.c | 9 |
4 files changed, 9 insertions, 6 deletions
@@ -406,5 +406,5 @@ void adb_mouse_init(ADBBusState *bus) d = adb_register_device(bus, ADB_MOUSE, adb_mouse_request, adb_mouse_reset, s); adb_mouse_reset(d); - qemu_add_mouse_event_handler(adb_mouse_event, d, 0); + qemu_add_mouse_event_handler(adb_mouse_event, d, 0, "QEMU ADB Mouse"); } @@ -560,7 +560,7 @@ void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg) s->common.update_arg = update_arg; ps2_reset(&s->common); register_savevm("ps2mouse", 0, 2, ps2_mouse_save, ps2_mouse_load, s); - qemu_add_mouse_event_handler(ps2_mouse_event, s, 0); + qemu_add_mouse_event_handler(ps2_mouse_event, s, 0, "QEMU PS/2 Mouse"); qemu_register_reset(ps2_reset, &s->common); return s; } diff --git a/hw/slavio_serial.c b/hw/slavio_serial.c index 404138d4b0..928ff4c917 100644 --- a/hw/slavio_serial.c +++ b/hw/slavio_serial.c @@ -682,7 +682,7 @@ void slavio_serial_ms_kbd_init(int base, int irq) slavio_serial_io_memory = cpu_register_io_memory(0, slavio_serial_mem_read, slavio_serial_mem_write, s); cpu_register_physical_memory(base, SERIAL_MAXADDR, slavio_serial_io_memory); - qemu_add_mouse_event_handler(sunmouse_event, &s->chn[0], 0); + qemu_add_mouse_event_handler(sunmouse_event, &s->chn[0], 0, "QEMU Sun Mouse"); qemu_add_kbd_event_handler(sunkbd_event, &s->chn[1]); qemu_register_reset(slavio_serial_reset, s); slavio_serial_reset(s); diff --git a/hw/usb-hid.c b/hw/usb-hid.c index 095fcb3e6c..bde3a7c67c 100644 --- a/hw/usb-hid.c +++ b/hw/usb-hid.c @@ -39,6 +39,7 @@ typedef struct USBMouseState { int x, y; int kind; int mouse_grabbed; + QEMUPutMouseEntry *eh_entry; } USBMouseState; /* mostly the same values as the Bochs USB Mouse device */ @@ -259,7 +260,8 @@ static int usb_mouse_poll(USBMouseState *s, uint8_t *buf, int len) int dx, dy, dz, b, l; if (!s->mouse_grabbed) { - qemu_add_mouse_event_handler(usb_mouse_event, s, 0); + s->eh_entry = qemu_add_mouse_event_handler(usb_mouse_event, s, + 0, "QEMU USB Mouse"); s->mouse_grabbed = 1; } @@ -295,7 +297,8 @@ static int usb_tablet_poll(USBMouseState *s, uint8_t *buf, int len) int dz, b, l; if (!s->mouse_grabbed) { - qemu_add_mouse_event_handler(usb_tablet_event, s, 1); + s->eh_entry = qemu_add_mouse_event_handler(usb_tablet_event, s, + 1, "QEMU USB Tablet"); s->mouse_grabbed = 1; } @@ -503,7 +506,7 @@ static void usb_mouse_handle_destroy(USBDevice *dev) { USBMouseState *s = (USBMouseState *)dev; - qemu_add_mouse_event_handler(NULL, NULL, 0); + qemu_remove_mouse_event_handler(s->eh_entry); qemu_free(s); } |