KeyboardStateView is a straightforward tool that allows you to visualize whether mouse and keyboard keys are functioning as they should.
The data collected is in real-time and will give you all the details needed to figure out if there is a hardware or software issue. It is a simple portable tool for diagnostic purposes and details the current state and virtual key code of every key you press.
For every key, KeyboardStateView displays the following information Key Name (VK_XXXX ), Description, Key Code (Decimal), Key Code (Hexadecimal), Key Pressed Status, Key Toggled Status (Useful for Num Lock, Caps Lock), and last time that the key was pressed. There are not many configuration options other than setting it to show all current session keys pressed which will be useful for testing a new keyboard or mouse.