JavaScript Keyboard Event Tester

Focus the test area and press keys to inspect the keydown, keyup, key, code, location, repeat, modifier, composition, and timing data that this browser receives.

Event capture and log controls

Filtering changes the table view only; it does not delete the complete in-memory log.

Waiting for a keyboard event Tab keeps native focus navigation. Pausing, losing focus, or hiding the page clears active keys and the timing baseline, while the history remains.
Retained log
0
Active keys
0
Keydown / keyup
0 / 0
Oldest entries removed
0

Currently active keys

  • No keys are currently held down.
Focus the test area, then press a key to inspect its event.
Current event summary Waiting for an event
Current key Waiting for a browser event
code
location
repeat
Event gap

Focus the capture area and press a key. This page records only events received by that area, not the system-wide keyboard.

Keyboard event log

The in-memory log keeps up to 500 entries. The table shows the latest 100 rows after filtering; downloads include the complete in-memory log.

Showing 0; retaining 0 in memory.
#typekeycodelocationrepeatisComposingmodifiersΔ mshold ms
No event matches the current filter yet.

Event types and timing gaps

Event-type counts

Compare keydown, keyup, auto-repeat, and composition event counts in the current in-memory log.

Consecutive event-gap distribution

The histogram uses positive gaps only within one consecutive recording phase. Pausing, losing focus, or hiding the page resets the timing baseline.

Learn more

Event fields and timing

key describes the character or meaning under the active layout; code describes a relatively stable physical position; location distinguishes the standard area, sides, and numeric keypad. Event gaps use consecutive Event.timeStamp differences. Hold time pairs the first non-repeat keydown for a code with its later keyup.

Unrounded millisecond values are retained internally. The page usually shows two decimal places; gaps and hold times are never calculated across a pause, focus loss, or hidden-page phase.

Checks require keydown or keyup events and non-negative finite timestamps. Reversed, invalid, or longer-than-10-minute differences are excluded from gap and hold-time statistics.

Browser boundaries and log limits

This tool analyzes only KeyboardEvent objects received by the current page's test area. Tab keeps native navigation and is not logged; browser or system shortcuts, Fn, and some media keys may not be captured. key depends on layout and input method, while code cannot replace character semantics. The in-memory log holds at most 500 entries and disappears on refresh or close.

What is the difference between KeyboardEvent key and code?

key describes the character or meaning produced by the active layout and modifiers. code describes a relatively stable physical key position. Use key for layout or character issues and usually record code as well for fixed-key or game controls.

How can I view keydown and keyup events?

Focus the capture area by clicking or pressing Tab, then press keys. The page logs keydown and keyup in arrival order and shows repeat, modifiers, composition state, event gaps, and hold time when a pair can be matched.

What is KeyboardEvent location used for?

location commonly uses 0 for the standard section, 1 for the left side, 2 for the right side, and 3 for the numeric keypad. It can distinguish left and right Shift, Ctrl, Alt, Meta, and main-row versus keypad keys.

Privacy, sources, and license

All events and logs are processed in this browser's page memory. Nothing is uploaded, no third-party API is called, and no URL or local storage is written. Downloads and copying happen only after a user action.

No third-party runtime code or assets are reused. The algorithm and interface are independently implemented; external links explain browser event standards only.

Standards and method sources