when a key is pressed,how the IRP transfer

Dear all
I want to know when one key is pressed how the function driver know and
which IRP produce. Is it IRP_MJ_READ? If it is who produce it and how it
transfer?

Read WDK documentation - it explains input architecture in detail. In addition to that, look closely at i8042prt and kbdclass samples, so that you will understand how it all works. Basically, i8042prt’s ISR reads a keystroke from the IO port , and queues a DPC that invokes a callback that kbdclass registers with i8042prt…

Anton Bassov

I read WDK documentation–the document says the i8042prt’s for PS/2-style keyboard and mouse devices. But I do not know whether it suit to usb-style keyboard.Can i8042prt’s IRP read a keystroke from the usb keyboard’s IO port?

On Mon, May 26, 2008 at 12:37:15AM -0400, xxxxx@neusoft.com wrote:

I read WDK documentation–the document says the i8042prt’s for
PS/2-style keyboard and mouse devices. But I do not know whether it suit
to usb-style keyboard.Can i8042prt’s IRP read a keystroke from the usb
keyboard’s IO port?

No. Entirely different mechanism. A USB keyboard is a USB device.
The USB HID driver uses sends a request to the host controller driver,
where it sits until the USB device has something to send.

Tim Roberts, xxxxx@probo.com
Providenza & Boeklheide, Inc.

Can you tell me the difference between PS/2 and usb ,about driver?

Hello,

both driver stacks are documented:
“Driver Stacks for USB Keyboard, Mouse, and Joystick Devices”
(http://msdn.microsoft.com/en-us/library/ms790189.aspx)
“Driver Stacks for Non-HIDClass Keyboard and Mouse Devices”
(http://msdn.microsoft.com/en-us/library/ms790194.aspx)

But what do you want to achieve?
If it’s just about common keyboard events, you don’t have to care about such details, but filter the callback chain instead (http://msdn.microsoft.com/en-us/library/ms790239.aspx).

A lot. I realize that you’re new to both Windows drivers and to this list, but that doesn’t mean that you don’t need to read the
documentation. Most people on this list do this professionally and have their own work to do. We’re happy to help when you’re
stuck on something in particular, but we’re not hear to tell you how to write and entire driver, and you haven’t said what it is
that you’re even trying to do.

I would recommend that you do what Anton suggested a while back - look at the sample for i8042; for USB, there isn’t as direct a
sample, and you’re going to have to read the WDK documentation on USB, possibly HID, and probably the USB spec itself. This will
keep you busy for a long time. If you have something specific in mind like ‘I want to filter all keystrokes regardless of keyboard
port type’ then try asking that and see what happens, but ‘how do I write a driver’ is not going to get an answer here, because
there is no simple answer.

Good luck,

mm

xxxxx@neusoft.com wrote:

Can you tell me the difference between PS/2 and usb ,about driver?

Thank you and sorry,I have finished a keyboard filter driver.

On Mon, May 26, 2008 at 04:11:19AM -0400, xxxxx@neusoft.com wrote:

Can you tell me the difference between PS/2 and usb ,about driver?

Most important is the one thing they have in common: in both cases,
you do not need to write a driver. As long as your hardware is built
to the PS/2 spec or the USB HID spec, the standard operating system
drivers will handle your device automatically.

Tim Roberts, xxxxx@probo.com
Providenza & Boeklheide, Inc.

PS/2 is not a HID device, unlike USB

So, except KBDCLASS on top, there is nothing common.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Can you tell me the difference between PS/2 and usb ,about driver?
>