usb keyboard driver

I am writing a driver for usb keyboard using WDF. I am confused how to handle IRP_MJ_READ to read keyboard data. How to handle interrupt…the keyboard has two interrupt pipe…

one more question is …“How to install my driver above keyboard class driver…” how to do this using .inf file? what device class should i use…HID or KEYBOARD…there is interface class…what should it be for my usb keyboard?

Why not just make your keyboard a HID device and conform oto the usb HID spec and then you do not have to write a driver?

…anyways, you want to install the driver in the keyboard class. This will install kbdclass above your driver automatically. You do not handle IRP_MJ_READ, kbdclass does that. You respond to the connect IOCTL and call the service callback when you have data. As for how to handle the interrupt endpoint, that is up to your device. you will probably need a continuous reader to always get data. In the completion routine you process it and can report the appropriate values in a KEYBOARD_INPUT_DATA

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, April 01, 2008 9:29 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] usb keyboard driver

I am writing a driver for usb keyboard using WDF. I am confused how to handle IRP_MJ_READ to read keyboard data. How to handle interrupt…the keyboard has two interrupt pipe…

one more question is …“How to install my driver above keyboard class driver…” how to do this using .inf file? what device class should i use…HID or KEYBOARD…there is interface class…what should it be for my usb keyboard?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer