KEYBOARD BASICS

As the user presses and releases keys, the keyboard driver passes the keystrokes to Windows. Windows saves the keystrokes in the system message queue and then transfers them to the message queue of the program with the ”input focus.“ These messages are processed in the program's window procedure. In most cases, the keyboard information encoded in these messages is probably more than your program needs. Part of the job of handling the keyboard is knowing which messages are important and which are not.