diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-06-03 18:45:02 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-06-03 18:45:02 +0000 |
commit | 63066f4f13b024ac0a45486f06dafbbf944fe4c6 (patch) | |
tree | dc1ce0a2b8d1c31b21486a37c1b6d92d91bb93f9 /hw/pckbd.c | |
parent | caf9a12e9ad9cdd89e9b13a01b359673f25b6313 (diff) | |
download | qemu-63066f4f13b024ac0a45486f06dafbbf944fe4c6.zip qemu-63066f4f13b024ac0a45486f06dafbbf944fe4c6.tar.gz qemu-63066f4f13b024ac0a45486f06dafbbf944fe4c6.tar.bz2 |
hid event handling
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@880 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pckbd.c')
-rw-r--r-- | hw/pckbd.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -190,9 +190,9 @@ static void kbd_queue(KBDState *s, int b, int aux) kbd_update_irq(s); } -void kbd_put_keycode(int keycode) +static void pc_kbd_put_keycode(void *opaque, int keycode) { - KBDState *s = &kbd_state; + KBDState *s = opaque; kbd_queue(s, keycode, 0); } @@ -434,9 +434,10 @@ static void kbd_mouse_send_packet(KBDState *s) s->mouse_dz -= dz1; } -void kbd_mouse_event(int dx, int dy, int dz, int buttons_state) +static void pc_kbd_mouse_event(void *opaque, + int dx, int dy, int dz, int buttons_state) { - KBDState *s = &kbd_state; + KBDState *s = opaque; /* check if deltas are recorded when disabled */ if (!(s->mouse_status & MOUSE_STATUS_ENABLED)) @@ -652,4 +653,7 @@ void kbd_init(void) register_ioport_write(0x60, 1, 1, kbd_write_data, s); register_ioport_read(0x64, 1, 1, kbd_read_status, s); register_ioport_write(0x64, 1, 1, kbd_write_command, s); + + qemu_add_kbd_event_handler(pc_kbd_put_keycode, s); + qemu_add_mouse_event_handler(pc_kbd_mouse_event, s); } |