Copyright © 1997-1999 Mark Russinovich | |
Last Updated November 22, 1999, Version 2.0 |
|
Introduction | Ctrl2cap is a kernel-mode
device driver that filters the system's keyboard class driver in order to
convert caps-lock characters into control characters. People like myself that
migrated to NT from UNIX are used to having the control key located where the
caps-lock key is on the standard PC keyboard, so a utility like this is
essential for our editing well-being. Ctrl2cap works on NT 4.0 and Win2K. See Ctrl2cap for Windows 9x for a version that works on Windows 95/98. |
Installation and Use | Install Ctrl2cap running the command "ctrl2cap /install" from the directory into which you've unzipped the Ctrl2cap files. To uninstall type "ctrl2cap /uninstall". |
Building Ctrl2cap | Ctrl2cap requires ntddkbd.h from the ddk\src\input\inc directory, so you must first copy that file to the ctrl2cap directory. To build a standard NT 4 driver type "buildnt4" and to build a Win2K WDM driver type "buildnt5". Output files are placed in the \release subdirectory. |
How Ctrl2cap Works |
On NT 4 Ctrlcap is actually
quite trivial. It simply attaches itself to the keyboard class driver so that
it will catch keyboard read requests. For each request, it posts an I/O
completion callback, at which point it takes a peek at the scancode that is
being returned. If it happens to be a caps-lock, ctrl2cap changes it into a
left-control. On Win2K Ctrl2cap is a WDM filter driver that layers in the keyboard class device's stack above the keyboard class device. This is in contrast to the Win2K DDK's kbfiltr example that layers itself between the i8042 port device and the keyboard class device. I chose to layer on top of the keyboard class device for several reasons:
|
More Information |
For more information on writing
filter drivers (drivers that attach themselves to other drivers so that they
can see their input and/or output), here are sources to check out:
|