Overview

Windows supports mice with up to five buttons: left, middle, and right, plus two additional buttons.

Mice also have a scroll wheel that can also be clickable, making it the middle button.

Win32

Keyboard

The keyboard is used for distinct types of input:

When the user presses a key, the hardware generates a scan code.

Scan codes are device-depend and there are separate scan codes for key-up and key-down events.

Windows translates the scan codes from the keyboard driver into virtual-key codes that are device-independent.

<aside> 📎 The list of virtual-key codes is in the Microsoft Documentation.

</aside>

The virtual-key code for the numeric keys correspond to their ASCII code.

The virtual-key code for the alphabetic keys correspond to their uppercase ASCII code.

The naming of some of the virtual-key codes is not intuitive, and correspond to the following keys.

Untitled Database

Keys

When the user presses or releases a key when a window has keyboard focus, the window receives one of the following messages.

Untitled Database