Site menu Yet another keyboard tester

Yet another keyboard tester

  
Layout:  

This keyboard tester is dedicated to the mechanical keyboard DIY community. Inspired by the well-known Keyboard Tester website, this page implements a number of improvements to better serve the needs of DIYers:

Cursor focus should be on the page. If the keystrokes are not being registered, try to click anywhere inside the page.

If a key is pressed but it does not exist in the current layout, the following message is shown below the keyboard: Keycode not found in this layout followed by the key code. This may happen as a matter of course e.g. if you test a PC keyboard on the Mac layout (it does not matter if the computer is PC or Mac).

More layouts will be added as time goes by. Leave a comment to suggest which layouts should come next, so we can gauge the interest and re-prioritize. This page is tested in the following browsers: Chrome, Safari, Firefox and Edge; and on the following platforms: Linux, Mac, Windows and Android. Please report any perceived bugs or issues.

Where are the national layouts?

The idea of this tool is to test physical keys — to make sure your keyboard a) can generate all scan codes typically present on a common keyboard, b) has all keys in their expected positions, and c) is compatible with all major platforms, if necessary.

If Shift-2 types a quote instead of "@", this is not a keyboard problem; it is a matter of locale configuration, outside the scope of this tool. That's why the on-screen label is just "2", not "@2".

This might cause some confusion in punctuation keys. For example, the Slash key, next to the right Shift in ANSI and ISO layouts, is labeled as hyphen in the Portuguese layout. In these cases, pay attention to the relative position of the key, not to the label.

In the ISO layout, the additional key next to left Shift is labeled as backslash, and the ex-backslash key (the last one at the third alphanumeric row) is labeled as "#". In both cases we followed the UK layout convention, but every country assigns different characters to these particular keys.

Two exceptions to this rule are the ANSI and ABNT2 layouts: all punctuation keys get the correct labels. This is because these physical layouts imply specific locales (USA and Brazil, respectively), while ISO is the base of numerous locales.

The Mac layout is actually ANSI-Mac. The ISO-Mac layout may be added in the future if there is user interest.

Platform-specific behaviors and issues

Some combinations of platforms and browsers may show slightly different behavior. We work around these deviations when possible.

Implementation details

This page uses KeyboardEvent.code, a relatively new API to handle keystrokes. Under this API, all keys are handled the same way, including modifier and navigational keys. Also, the reported codes refer to physical key positions. Even though they are strings, the codes can be correlated to PS/2 or USB HID scancodes.

For example, the "Q" key in a QWERTY keyboard is the 2nd key of the 2nd alphanumeric row. It is immediately at right of the "Tab" key, and it is always reported as code "KeyQ" — even when the configured locale is French, whose national layout is AZERTY, in which the "KeyQ" key is expected to type the character "A" instead of the character "Q".

The USB HID specification works the same way: the scancode 0x14 is the "Q" on a QWERTY key and is the "A" on AZERTY. The physical position of the scancode 0x14 is preserved, so French, German and English keyboards can share the same hardware and firmware, only the keycaps need to relocated.

This page describes the KeyboardEvent.code in detail, and this W3C specification lists the supported keyboard layouts and key codes.