HOWTO: Read USB keyboard input from boot driver

Discussion in 'Windows Vista Drivers' started by Omer, May 8, 2005.

  1. Omer

    Omer Guest


    I want to read USB keyboard input from a boot driver.
    How can this be done?
    (I know READ_PORT_UCHAR can be used to read regular keyboard input...
    can I use it also for USB one?)

    Omer, May 8, 2005
    1. Advertisements

  2. first off, reading the i/o resources diretly is a no no. enumerate the
    keyboard device interface guid (it is defined in ntddkbd.h, you can also
    find it in the kbdclass ddk example). then, open each keyboard and pend a
    read to it. the buffer will be a KEYBOARD_INPUT_DATA. Note that i said
    *each* keyboard. there can be a few on the machine, both real and virtual.
    even if there are no virtual keyboards and only a usb keyboard, there can be
    both a ps2 and usb keyboard enumerated b/c the BIOS fakes out the ps2
    keyboard until the OS comes online.

    Doron Holan [MS], May 8, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.