1 /////////////////////////////////////////////////////////////////////////
2 // $Id: usb_hid.h,v 1.5 2007/09/28 19:52:06 sshwarts Exp $
3 /////////////////////////////////////////////////////////////////////////
5 // Copyright (C) 2007 Volker Ruppert
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Lesser General Public License for more details.
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 // USB HID emulation support ported from the Qemu project
23 #ifndef BX_IODEV_USB_HID_H
24 #define BX_IODEV_USB_HID_H
27 class usb_hid_device_t
: public usb_device_t
{
29 usb_hid_device_t(usbdev_type type
);
30 virtual ~usb_hid_device_t(void);
32 virtual void handle_reset();
33 virtual int handle_control(int request
, int value
, int index
, int length
, Bit8u
*data
);
34 virtual int handle_data(USBPacket
*p
);
35 virtual void register_state_specific(bx_list_c
*parent
);
36 void mouse_enq(int delta_x
, int delta_y
, int delta_z
, unsigned button_state
);
37 bx_bool
key_enq(Bit8u
*scan_code
);
39 int mouse_poll(Bit8u
*buf
, int len
);
40 int keypad_poll(Bit8u
*buf
, int len
);
52 Bit8u key_pad_packet
[8];