Drivers Sveon Input Devices



Input device enables the user to send data, information, or control signals to a computer. The Central Processing Unit (CPU) of a computer receives the input and processes it to produce the output.

Input

Check the box to uninstall the driver. A warning box will pop up and you tell it Yes. Now restart the computer. Upon the restart, the soundcard drivers will reinstall. If sounds are still not working, go back in the Device Manager, right click on the first item listed in the sound category and select properties. You get a window like this. A device driver is a special kind of software program that controls a specific hardware device attached to a computer. Device drivers are essential for a computer to work properly.

Some of the popular input devices are:

1) Keyboard

The keyboard is a basic input device that is used to enter data into a computer or any other electronic device by pressing keys. It has different sets of keys for letters, numbers, characters, and functions. Keyboards are connected to a computer through USB or a Bluetooth device for wireless communication.

Types of keyboards: There can be different types of keyboards based on the region and language used. Some of the common types of keyboards are as follows:

i) QWERTY Keyboard:

It is the most commonly used keyboard with computers in modern times. It is named after the first six letters of the top row of buttons and is even popular in countries that do not use Latin-based alphabet. It is so popular that some people think that it is the only type of keyboard to use with computers as an input device.

ii) AZERTY Keyboard:

It is considered the standard French keyboard. It is developed in France as an alternative layout to the QWERTY layout and is mainly used in France and other European countries. Some countries have manufactured their own versions of AZERTY.

Its name is derived from the first six letters that appear on the top left row of the keyboard. The Q and W keys in AZERTY keyboard are interchanged with A and Z keys in QWERTY keyboard. Furthermore, in AZERTY keyboard M key is located to the left of the L key.

AZERTY keyboard differs from QWERTY keyboard not only in the placement of letters but also in many other ways, e.g., it gives emphasis on accents, which is required for writing European languages like French.

iii) DVORAK Keyboard:

This type of keyboard layout was developed to increase the typing speed by reducing the finger movement while typing. The most frequently used letters are kept in a home row to improve typing.

2) Mouse

The mouse is a hand-held input device which is used to move cursor or pointer across the screen. It is designed to be used on a flat surface and generally has left and right button and a scroll wheel between them. Laptop computers come with a touchpad that works as a mouse. It lets you control the movement of cursor or pointer by moving your finger over the touchpad. Some mouse comes with integrated features such as extra buttons to perform different buttons.

The mouse was invented by Douglas C. Engelbart in 1963. Early mouse had a roller ball integrated as a movement sensor underneath the device. Modern mouse devices come with optical technology that controls cursor movements by a visible or invisible light beam. A mouse is connected to a computer through different ports depending on the type of computer and type of a mouse.

Common types of the mouse:

i) Trackball Mouse:

It is a stationary input device that has ball mechanism to move the pointer or cursor on the screen. The ball is half inserted in the device and can be easily rolled with finger, thumb or the palm to move the pointer on the screen. The device has sensor to detect the rotation of ball. It remains stationary; you don't need to move it on the operating surface. So, it is an ideal device if you have limited desk space as you don't need to move it like a mouse.

ii) Mechanical Mouse:

It has a system of a ball and several rollers to track its movement. It is a corded type of mouse. A mechanical mouse can be used for high performance. The drawback is that they tend to get dust into the mechanics and thus require regular cleaning.

iii) Optical Mouse:

An optical mouse uses optical electronics to track its movement. It is more reliable than a mechanical mouse and also requires less maintenance. However, its performance is affected by the surface on which it is operated. Plain non-glossy mouse mat should be used for best results. The rough surface may cause problems for the optical recognition system, and the glossy surface may reflect the light wrongly and thus may cause tracking issues.

iv) Cordless or Wireless Mouse:

As the name suggests, this type of mouse lacks cable and uses wireless technology such as IrDA (infrared) or radio (Bluetooth or Wi-Fi) to control the movement of the cursor. It is used to improve the experience of using a mouse. It uses batteries for its power supply.

3) Scanner

The scanner uses the pictures and pages of text as input. It scans the picture or a document. The scanned picture or document then converted into a digital format or file and is displayed on the screen as an output. It uses optical character recognition techniques to convert images into digital ones. Some of the common types of scanners are as follows:

Types of Scanner:

i) Flatbed Scanner:

It has a glass pane and a moving optical CIS or CCD array. The light illuminates the pane, and then the image is placed on the glass pane. The light moves across the glass pane and scans the document and thus produces its digital copy. You will need a transparency adapter while scanning transparent slides.

ii) Handheld Scanner:

It is a small manual scanning device which is held by hand and is rolled over a flat image that is to be scanned. The drawback in using this device is that the hand should be steady while scanning; otherwise, it may distort the image. One of the commonly used handheld scanners is the barcode scanner which you would have seen in shopping stores.

iii) Sheetfed Scanner:

In this scanner, the document is inserted into the slot provided in the scanner. The main components of this scanner include the sheet-feeder, scanning module, and calibration sheet. The light does not move in this scanner. Instead, the document moves through the scanner. It is suitable for scanning single page documents, not for thick objects like books, magazines, etc.

iv) Drum Scanner:

Drum scanner has a photomultiplier tube (PMT) to scan images. It does not have a charge-coupled device like a flatbed scanner. The photomultiplier tube is extremely sensitive to light. The image is placed on a glass tube, and the light moves across the image, which produces a reflection of the image which is captured by the PMT and processed. These scanners have high resolution and are suitable for detailed scans.

v) Photo Scanner:

It is designed to scan photographs. It has high resolution and color depth, which are required for scanning photographs. Some photo scanners come with in-built software for cleaning and restoring old photographs.

4) Joystick

A joystick is also a pointing input device like a mouse. It is made up of a stick with a spherical base. The base is fitted in a socket that allows free movement of the stick. The movement of stick controls the cursor or pointer on the screen.

The frist joystick was invented by C. B. Mirick at the U.S. Naval Research Laboratory. A joystick can be of different types such as displacement joysticks, finger-operated joysticks, hand operated, isometric joystick, and more. In joystick, the cursor keeps moving in the direction of the joystick unless it is upright, whereas, in mouse, the cursor moves only when the mouse moves.

5) Light Pen

A light pen is a computer input device that looks like a pen. The tip of the light pen contains a light-sensitive detector that enables the user to point to or select objects on the display screen. Its light sensitive tip detects the object location and sends the corresponding signals to the CPU. It is not compatible with LCD screens, so it is not in use today. It also helps you draw on the screen if needed. The first light pen was invented around 1955 as a part of the Whirlwind project at the Massachusetts Institute of Technology (MIT).

6) Digitizer

Digitizer is a computer input device that has a flat surface and usually comes with a stylus. It enables the user to draw images and graphics using the stylus as we draw on paper with a pencil. The images or graphics drawn on the digitizer appear on the computer monitor or display screen. The software converts the touch inputs into lines and can also convert handwritten text to typewritten words.

It can be used to capture handwritten signatures and data or images from taped papers. Furthermore, it is also used to receive information in the form of drawings and send output to a CAD (Computer-aided design) application and software like AutoCAD. Thus, it allows you to convert hand-drawn images into a format suitable for computer processing.

7) Microphone

The microphone is a computer input device that is used to input the sound. It receives the sound vibrations and converts them into audio signals or sends to a recording medium. The audio signals are converted into digital data and stored in the computer. The microphone also enables the user to telecommunicate with others. It is also used to add sound to presentations and with webcams for video conferencing. A microphone can capture audio waves in different ways; accordingly the three most common types are described below:

i) Dynamic:

It is the most commonly used microphone with a simple design. It has a magnet which is wrapped by a metal coil and a thin sheet on the front end of the magnet. The sheet transfers vibrations from sound waves to the coil and from coil to electric wires which transmit the sound like an electrical signal.

ii) Condenser:

It is designed for audio recording and has a very sensitive and flat frequency response. It has a front plate called diaphragm and a back plate parallel to the front plate. When sound hits the diaphragm, it vibrates the diaphragm and alters the distance between the two plates. The changes in distance are transmitted as electric signals.

iii) Ribbon:

It is known for its reliability. It has a thin ribbon made of aluminum, duraluminum, or nanofilm suspended in a magnetic field. The sound waves cause vibrations in the ribbon, which generate a voltage proportional to the velocity of the vibration. The voltage is transmitted as an electrical signal. Early ribbon microphones had a transformer to increase the output voltage, but modern ribbon microphones come with advanced magnets to produce a strong signal.

8) Magnetic Ink Character Recognition (MICR)

MICR computer input device is designed to read the text printed with magnetic ink. MICR is a character recognition technology that makes use of special magnetized ink which is sensitive to magnetic fields. It is widely used in banks to process the cheques and other organizations where security is a major concern. It can process three hundred cheques in a minute with hundred-percent accuracy. The details on the bottom of the cheque (MICR No.) are written with magnetic ink. A laser printer with MICR toner can be used to print the magnetic ink.

The device reads the details and sends to a computer for processing. A document printed in magnetic ink is required to pass through a machine which magnetizes the ink, and the magnetic information is then translated into characters.

9) Optical Character Reader (OCR)

OCR computer input device is designed to convert the scanned images of handwritten, typed or printed text into digital text. It is widely used in offices and libraries to convert documents and books into electronic files.

It processes and copies the physical form of a document using a scanner. After copying the documents, the OCR software converts the documents into a two-color (black and white), version called bitmap. Then it is analyzed for light and dark areas, where the dark areas are selected as characters, and the light area is identified as background. It is widely used to convert hard copy legal or historic documents into PDFs. The converted documents can be edited if required like we edit documents created in ms word.

10) Digital camera:

It is a digital device as it captures images and records videos digitally and then stores them on a memory card. It is provided with an image sensor chip to capture images, as opposed to film used by traditional cameras. Besides this, a camera that is connected to your computer can also be called a digital camera.

It has photosensors to record light that enters the camera through the lens. When the light strikes the photosensors, each of the sensors returns the electrical current, which is used to create the images.

11) Paddle:

It is a simple input device that is widely used in games. It is a wheel that is held by hand and looks like a volume knob on a stereo that is used to increase or decrease the volume. Paddle moves or controls cursor or any other objects in the game in a back-and-forth motion. It is widely used as an alternative to the joystick. Besides this, the term paddle also refers to many handheld devices designed to control a function in an electronic device, computer, etc.

12) Steering wheel:

It is used as an input device in racing video games such as car racing games or in driving programs as virtual simulators to steer a vehicle. It works like the real steering wheel by allowing you to take a right or left turn. A steering wheel may be provided with acceleration and brake pedal devices and a mechanism for shifting gears. Thus, it makes racing games more adventurous and entertaining.

13) Gesture recognition devices:

These devices take human gestures as input. There are many such devices that respond to gestures. For example, Kinect is one such device that observes the movement of a player's body and interprets these movements as inputs to video games. This feature is also available in certain tablets and smartphones where you can perform certain tasks such as taking pictures using finger gestures such as swiping, pinching, etc.

14) Light Gun:

As the name suggests, it is a pointing input device that is designed to point at and shoot the targets on the screen in a video game, or arcade, etc. The light gun was used for the first time on the MIT Whirwind computer. When the gun is pointed at the target on the screen and the trigger is pulled, the screen goes blank for a fraction of a second. During this moment, the photodiode, which is present in the barrel, determines where the gun is pointed. For example, shooting ducks in a duck hunt game.

15) Touchpad:

It is usually found in laptops as a substitute for the mouse. It allows you to move or control the cursor on the screen using your finger. Just like a mouse, it also has two buttons for right and left click. Using the touchpad, you can perform all the tasks that you do with a mouse, such as selecting an object on the screen, copy, paste, delete, open a file or folder, and more.

16) Remote:

It is a hardware device designed to control the functioning of a device, e.g., a TV remote that can be used to change channels, increase or decrease the volume, from a distance without leaving the seat. The first cordless TV remote was invented by Dr. Robert Adler of Zenith in 1956. The remote sends the electromagnetic waves to communicate with the device. These waves can be infrared rays, radio waves, etc.

17) Touch screen:

It is the display screen of a device such as a smartphone, tablet, etc., that allows users to interact or provide inputs to the device by using their finger. Today, most of the electronic devices come with touchscreen as an alternative to a mouse for navigating a graphical user interface. For example, by touching, you can unlock your phone, open emails, open files, play videos, etc. Besides this, it is used in lots of devices such as Camera, Car GPS, Fitness machine, etc.

The concept of the touch screen was first introduced and published by E.A. Johnson in 1965. The first touch screen was developed at the beginning of the 1970s by CERN engineers Frank Beck and Bent Stumpe.

18) VR:

VR stands for virtual reality. It is an artificial or virtual environment which is generated by computers. A person can interact with virtual objects of this artificial environment using some input devices such as headsets, gloves, headphones, etc. For example, he or she can find himself or herself walking on a beach, watching a football match, walking in the sky, etc., without actually doing all this.

19) Webcam:

Any camera which is connected to a computer is called a webcam. The in-built camera provided on a computer can also be considered a webcam. It is an input device as it can take pictures, and can be used to record videos if required. The pictures and videos are stored in the computer memory and can be displayed on the screen if required. Although it works almost the same as the digital camera, it is different from a digital camera, as it is designed to take compact digital photos that can be uploaded easily on the webpages and shared with others through the internet.

20) Biometric Devices:

Biometrics refers to a process in which a person is identified through his or her biological features such as fingerprints, eye cornea, face structure, etc. It is done by using biometric devices, which can be of different types based on their scanning features and abilities, such as:

i) Face Scanner:

It is designed to identify a person by scanning his or her face. It takes the face measurements of a person. For example, the distance between eyes, nose, and mouth, etc., accordingly, it confirms the identity of a person. Besides this, it is smart enough to differentiate between a person's picture and the real person.

ii) Hand Scanner:

The hand of a person can also be used to verify his or her identity as every person has a unique pattern of veins in the palm, just like fingerprints. This device takes advantage of this feature; it identifies a person by scanning the palm of his hand. It uses infrared light to scan veins' patterns and blood flowing in them. Palm is even more unique than fingerprints.

iii) Fingerprint Scanner:

It scans the fingerprints to identify people or for biometric authentication. This device is developed, keeping in mind the fact that no two persons in the world can have the same fingerprints. It is widely used in companies as a fingerprint attendance system to mark the attendance of employees. This type of scanners captures the pattern of valleys and ridges found on a finger and store it in the memory or database. When you press your finger on the given space, it verifies the identity by using its pattern-matching software.

iv) Retina or Iris Scanner:

It scans the retina or iris of a person's eye to confirm the identity. This device is more secure than others as it is next to impossible to copy the retina or iris. It works by mapping the retina's blood vessel patterns of the eye. The blood vessels of retina absorb light more easily as well as can be identified with appropriate lighting.

In this scan, a beam of low-energy infrared light falls on the retina through the scanner's eyepiece. Then, the software captures the network of blood vessels in the retina and uses it to verify a person's identity.

v) Voice Scanner:

It records the voice of a person and digitizes it to create a distinctive voice print or template. The voiceprints are stored in the database, and are used to verify the voice of a person to confirm his or her identity. The person is required to speak in the normal or same voice that was used to create a voice template. It is not much reliable as it can be misused using a tape recording.

Next TopicOutput Devices

-->

Note

This topic is for developers who are creating drivers for keyboard and mouse HID clients. If you are looking to fix a mouse or keyboard, see:

This topic discusses keyboard and mouse HID client drivers. Keyboards and mice represent the first set of HID clients that were standardized in the HID Usage tables and implemented in Windows operating systems.

Keyboard and mouse HID client drivers are implemented in the form of HID Mapper Drivers. A HID mapper driver is a kernel-mode WDM filter driver that provides a bidirectional interface for I/O requests between a non-HID Class driver and the HID class driver. The mapper driver maps the I/O requests and data protocols of one to the other.

Windows provides system-supplied HID mapper drivers for HID keyboard, and HID mice devices.

Architecture and overview

The following figure illustrates the system-supplied driver stacks for USB keyboard and mouse/touchpad devices.

The figure above includes the following components:

  • KBDHID.sys – HID client mapper driver for keyboards. Converts HID usages into scancodes to interface with the existing keyboard class driver.
  • MOUHID.sys – HID client mapper driver for mice/touchpads. Converts HID usages into mouse commands (X/Y, buttons, wheel) to interface with the existing keyboard class driver.
  • KBDCLASS.sys – The keyboard class driver maintains functionality for all keyboards and keypads on the system in a secure manner.
  • MOUCLASS.sys – The mouse class driver maintains functionality for all mice / touchpads on the system. The driver does support both absolute and relative pointing devices. This is not the driver for touchscreens as that is managed by a different driver in Windows.
  • HIDCLASS.sys - The HID class driver. The HID Class driver is the glue between KBDHID.sys and MOUHID.sys HID clients and various transports (USB, Bluetooth, etc).

The system builds the driver stack as follows:

  • The transport stack creates a physical device object (PDO) for each HID device attached and loads the appropriate HID transport driver which in turn loads the HID Class Driver.
  • The HID class driver creates a PDO for each keyboard or mouse TLC. Complex HID devices (more than 1 TLC) are exposed as multiple PDOs created by HID class driver. For example, a keyboard with an integrated mouse might have one collection for the standard keyboard controls and a different collection for the mouse.
  • The keyboard or mouse hid client mapper drivers are loaded on the appropriate FDO.
  • The HID mapper drivers create FDOs for keyboard and mouse, and load the class drivers.

Important notes:

  • Vendor drivers are not required for keyboards and mice that are compliant with the supported HID Usages and top level collections.
  • Vendors may optionally provide filter drivers in the HID stack to alter/enhance the functionality of these specific TLC.
  • Vendors should create separate TLCs, that are vendor specific, to exchange vendor proprietary data between their hid client and the device. Avoid using filter drivers unless critical.
  • The system opens all keyboard and mouse collections for its exclusive use.
  • The system prevents disable/enabling a keyboard.
  • The system provides support for horizontal/vertical wheels with smooth scrolling capabilities.
Input

Driver Guidance

Microsoft provides the following guidance for IHVs writing drivers:

  1. Driver developers are allowed to add additional drivers in the form of a filter driver or a new HID Client driver. The criteria are described below:

    1. Filters Drivers: Driver developers should ensure that their value-add driver is a filter driver and does not replace (or be used in place of) existing Windows HID drivers in the input stack.

      • Filter drivers are allowed in the following scenarios:
        • As an upper filter to kbdhid/mouhid
        • As an upper filter to kbdclass/mouclass
      • Filter drivers are not recommended as a filter between HIDCLASS and HID Transport minidriver
    2. Function Drivers: Alternatively vendors can create a function driver (instead of a filter driver) but only for vendor specific HID PDOs (with a user mode service if necessary).

      Function drivers are allowed in the following scenarios:

      • Only load on the specific vendor’s hardware
    3. Transport Drivers: Windows team does not recommend creating additional HID Transport minidriver as they are complex drivers to write/maintain. If a partner is creating a new HID Transport minidriver, especially on SoC systems, we recommend a detailed architectural review to understand the reasoning and ensure that the driver is developed correctly.

  2. Driver developers should leverage driver Frameworks (KMDF or UMDF) and not rely on WDM for their filter drivers.

  3. Driver developers should reduce the number of kernel-user transitions between their service and the driver stack.

  4. Driver developers should ensure ability to wake the system via both keyboard and touchpad functionality (adjustable by the end user (device manager) or the PC manufacturer). In addition on SoC systems, these devices must be able to wake themselves from a lower powered state while the system is in a working S0 state.

  5. Driver developers should ensure that their hardware is power managed efficiently.

    • Device can go into its lowest power state when the device is idle.
    • Device is in the lowest power state when the system is in a low power state (for example, standby (S3) or connected standby).

Keyboard layout

A keyboard layout fully describes a keyboard's input characteristics for Microsoft Windows 2000 and later versions. For example, a keyboard layout specifies the language, keyboard type and version, modifiers, scan codes, and so on.

See the following for information about keyboard layouts:

  • Keyboard header file, kdb.h, in the Windows Driver Development Kit (DDK), which documents general information about keyboard layouts.

  • Sample keyboard layouts.

To visualize the layout of a specific keyboard, see Windows Keyboard Layouts.

For additional details around the keyboard layout, visit Control PanelClock, Language, and RegionLanguage.

Supported buttons and wheels on mice

The following table identifies the features supported across different client versions of the Windows operating system.

FeatureWindows XPWindows VistaWindows 7Windows 8 and later
Buttons 1-5Supported (P/2 & HID)Supported (PS/2 & HID)Supported (PS/2 & HID)Supported (PS/2 & HID)
Vertical Scroll WheelSupported (PS/2 & HID)Supported (PS/2 & HID)Supported (PS/2 & HID)Supported (PS/2 & HID)
Horizontal Scroll WheelNot SupportedSupported(HID only)Supported(HID only)Supported(HID only)
Smooth Scroll Wheel Support (Horizontal and Vertical)Not SupportedPartly SupportedSupported (HID only)Supported (HID only)

Activating buttons 4-5 and wheel on PS/2 mice

The method used by Windows to activate the new 4&5-button + wheel mode is an extension of the method used to activate the third button and the wheel in IntelliMouse-compatible mice:

  • First, the mouse is set to the 3-button wheel mode, which is accomplished by setting the report rate consecutively to 200 reports/second, then to 100 reports/second, then to 80 reports/second, and then reading the ID from the mouse. The mouse should report an ID of 3 when this sequence is completed.
  • Next, the mouse is set to the 5-button wheel mode, which is accomplished by setting the report rate consecutively to 200 reports/second, then to 200 reports/second again, then to 80 reports/second, and then reading the ID from the mouse. Once this sequence is completed, a 5-button wheel mouse should report an ID of 4 (whereas an IntelliMouse-compatible 3-button wheel mouse would still report an ID of 3).

Note that this is applicable to PS/2 mice only and is not applicable to HID mice (HID mice must report accurate usages in their report descriptor).

Standard PS/2-compatible mouse data packet format (2 Buttons)

ByteD7D6D5D4D3D2D1D0Comment
1YoverXoverYsignXsignTagMRLX/Y overvlows and signs, buttons
2X7X6X5X4X3X2X1X0X data byte
3Y7Y6Y5Y4Y3Y2Y1Y0Y data bytes

Note

Windows mouse drivers do not check the overflow bits. In case of overflow, the mouse should simply send the maximal signed displacement value.

Standard PS/2-compatible mouse data packet format (3 Buttons + VerticalWheel)

ByteD7D6D5D4D3D2D1D0Comment
100YsignXsign1MRLX/Y signs and R/L/M buttons
2X7X6X5X4X3X2X1X0X data byte
3Y7Y6Y5Y4Y3Y2Y1Y0Y data bytes
4Z7Z6Z5Z4Z3Z2Z1Z0Z/wheel data byte

Standard PS/2-compatible mouse data packet format (5 Buttons + VerticalWheel)

ByteD7D6D5D4D3D2D1D0Comment
100YsignXsign1MRLX/Y signs and R/L/M buttons
2X7X6X5X4X3X2X1X0X data byte
3Y7Y6Y5Y4Y3Y2Y1Y0Y data bytes
400B5B4Z3Z2Z1Z0Z/wheel data and buttons 4 and 5

Important

Notice that the Z/wheel data for a 5-button wheel mouse has been reduced to four bits instead of the 8 bits used in the IntelliMouse-compatible 3-button wheel mode. This reduction is made possible by the fact that the wheel typically cannot generate values beyond the range +7/-8 during any given interrupt period. Windows mouse drivers will sign extend the four Z/wheel data bits when the mouse is in the 5-button wheel mode, and the full Z/wheel data byte when the mouse operates in the 3-button wheel mode.

Buttons 4 & 5 on are mapped to WM_APPCOMMAND messages and correspond to App_Back and App_Forward.

Devices not requiring vendor drivers

Vendor drivers are not required for the following devices:

  • Devices that comply with the HID Standard.
  • Keyboard, mouse, or game port devices operated by the system-supplied non-HIDClass drivers.

Kbfiltr sample

Kbfiltr is designed to be used with Kbdclass, the system class driver for keyboard devices and I8042prt, the function driver for a PS/2-style keyboard. Kbfiltr demonstrates how to filter I/O requests and how to add callback routines that modify the operation of Kbdclass and I8042prt.

For more information about Kbfiltr operation, see the following:

  • The ntddkbd.h WDK header file.

  • The sample Kbfiltr source code.

Kbfiltr IOCTLs

IOCTL_INTERNAL_I8042_HOOK_KEYBOARD

The IOCTL_INTERNAL_I8042_HOOK_KEYBOARD request does the following:

  • Adds an initialization callback routine to the I8042prt keyboard initialization routine.
  • Adds an ISR callback routine to the I8042prt keyboard ISR.

The initialization and ISR callbacks are optional and are provided by an upper-level filter driver for a PS/2-style keyboard device.

After I8042prt receives an IOCTL_INTERNAL_KEYBOARD_CONNECT request, it sends a synchronous IOCTL_INTERNAL_I8042_HOOK_KEYBOARD request to the top of the keyboard device stack.

After Kbfiltr receives the hook keyboard request, Kbfiltr filters the request in the following way:

  • Saves the upper-level information passed to Kbfiltr, which includes the context of an upper-level device object, a pointer to an initialization callback, and a pointer to an ISR callback.
  • Replaces the upper-level information with its own.
  • Saves the context of I8042prt and pointers to callbacks that the Kbfiltr ISR callback can use.

IOCTL_INTERNAL_KEYBOARD_CONNECT

The IOCTL_INTERNAL_KEYBOARD_CONNECT request connects the Kbdclass service to the keyboard device. Kbdclass sends this request down the keyboard device stack before it opens the keyboard device.

After Kbfiltr received the keyboard connect request, Kbfiltr filters the connect request in the following way:

  • Saves a copy of Kbdclass's CONNECT_DATA (Kbdclass) structure that is passed to the filter driver by Kbdclass.
  • Substitutes its own connect information for the class driver connect information.
  • Sends the IOCTL_INTERNAL_KEYBOARD_CONNECT request down the device stack.

If the request is not successful, Kbfiltr completes the request with an appropriate error status.

Kbfiltr provides a template for a filter service callback routine that can supplement the operation of KeyboardClassServiceCallback, the Kbdclass class service callback routine. The filter service callback can filter the input data that is transferred from the device input buffer to the class data queue.

IOCTL_INTERNAL_KEYBOARD_DISCONNECT

The IOCTL_INTERNAL_KEYBOARD_DISCONNECT request is completed with a status of STATUS_NOT_IMPLEMENTED. Note that a Plug and Play keyboard can be added or removed by the Plug and Play manager.

For all other device control requests, Kbfiltr skips the current IRP stack and sends the request down the device stack without further processing.

Callback routines implemented by Kbfiltr

KbFilter_InitializationRoutine

See PI8042_KEYBOARD_INITIALIZATION_ROUTINE

The KbFilter_InitializationRoutine is not needed if the I8042prt default initialization of a keyboard is sufficient.

I8042prt calls KbFilter_InitializationRoutine when it initializes the keyboard. Default keyboard initialization includes the following operations:

  • reset the keyboard
  • set the typematic rate and delay
  • set the light-emitting diodes (LED)

KbFilter_IsrHook

See PI8042_KEYBOARD_ISR. This callback is not needed if the default operation of I8042prt is sufficient.

The I8042prt keyboard ISR calls KbFilter_IsrHook after it validates the interrupt and reads the scan code.

KbFilter_IsrHook runs in kernel mode at the IRQL of the I8042prt keyboard.

KbFilter_ServiceCallback

See PSERVICE_CALLBACK_ROUTINE.

The ISR dispatch completion routine of the function driver calls KbFilter_ServiceCallback, which then calls the keyboard class driver's implementation of PSERVICE_CALLBACK_ROUTINE. A vendor can implement a filter service callback to modify the input data that is transferred from the device's input buffer to the class data queue. For example, the callback can delete, transform, or insert data.

Moufiltr sample

Moufiltr is designed to be used with Mouclass, the system class driver for mouse devices used with Windows 2000 and later versions, and I8042prt, the function driver for a PS/2-style mouse used with Windows 2000 and later. Moufiltr demonstrates how to filter I/O requests and add callback routines that modify the operation of Mouclass and I8042prt.

For more information about Moufiltr operation, see the following:

  • The ntddmou.h WDK header file.

  • The sample Moufiltr source code.

Moufiltr control codes

IOCTL_INTERNAL_I8042_HOOK_MOUSE

The IOCTL_INTERNAL_I8042_HOOK_MOUSE request adds an ISR callback routine to the I8042prt mouse ISR. The ISR callback is optional and is provided by an upper-level mouse filter driver.

I8042prt sends this request after it receives an IOCTL_INTERNAL_MOUSE_CONNECT request. I8042prt sends a synchronous IOCTL_INTERNAL_I8042_HOOK_MOUSE request to the top of the mouse device stack.

After Moufiltr receives the hook mouse request, it filters the request in the following way:

  • Saves the upper-level information passed to Moufiltr, which includes the context of an upper-level device object and a pointer to an ISR callback.
  • Replaces the upper-level information with its own.
  • Saves the context of I8042prt and pointers to callbacks that the Moufiltr ISR callbacks can use.

Moufiltr Callback Routines

IOCTL_INTERNAL_MOUSE_CONNECT

The IOCTL_INTERNAL_MOUSE_CONNECT request connects Mouclass service to a mouse device.

IOCTL_INTERNAL_MOUSE_DISCONNECT

The IOCTL_INTERNAL_MOUSE_DISCONNECT request is completed by Moufiltr with an error status of STATUS_NOT_IMPLEMENTED.

For all other requests, Moufiltr skips the current IRP stack and sends the request down the device stack without further processing.

Callback routines

MouFilter_IsrHook

See PI8042_MOUSE_ISR.

A MouFilter_IsrHook callback is not needed if the default operation of I8042prt is sufficient.

The I8042prt mouse ISR calls MouFilter_IsrHook after it validates the interrupt.

To reset a mouse, I8042prt goes through a sequence of operational substates, each one of which is identified by an MOUSE_RESET_SUBSTATE enumeration value. For more information about how I8042prt resets a mouse and the corresponding mouse reset substates, see the documentation of MOUSE_RESET_SUBSTATE in ntdd8042.h.

Drivers Sveon Input Devices Device

MouFilter_IsrHook runs in kernel mode at the IRQL of the I8042prt mouse ISR.

MouFilter_ServiceCallback

See PSERVICE_CALLBACK_ROUTINE

Drivers Sveon Input Devices Using

The ISR DPC of I8042prt calls MouFilter_ServiceCallback, which then calls MouseClassServiceCallback. A filter service callback can be configured to modify the input data that is transferred from the device's input buffer to the class data queue. For example, the callback can delete, transform, or insert data.