With this tool, JavaScript keycodes in bulk must be captured one focused keydown at a time because the JavaScript Key Code Finder keeps only the latest event and has no bulk-capture history. It captures one browser KeyboardEvent locally, so the honest bulk workflow is to inspect and copy records for a defined key list, then combine those saved records outside the tool. It cannot generate a single export of every keycode, and each new press replaces the currently displayed record.

A bulk request can mean either a static lookup table or a collection of test fixtures. This product can supply diagnostic records for the latter, but it does not preserve an event history. Copying multiple results therefore requires returning focus to the capture area and saving each JSON object before pressing the next key.

javascript keycodes bulk
JavaScript Keycodes Bulk: Build a Test Fixture Set

Separate a bulk lookup table from event data

Legacy numeric tables can conceal differences between layouts, browsers, and devices. Modern keyboard handling depends on distinct values with distinct purposes. The W3C UI Events specification defines key as the value produced from the current layout and modifier state, while code identifies the physical key position.

Captured value What it represents Why it matters in a bulk set
key The layout-adjusted meaning of the key Preserve the character or named action produced on each target layout
code The physical key position, such as KeyW or Digit2 Use it when behavior depends on placement rather than the produced character
location Standard, left, right, or numpad placement Retain distinctions between side-specific modifiers, Enter keys, and numeric keys
Modifier list Modifier state included in that event Store the event snapshot rather than treating it as a history of every key pressed
repeat Whether the event is a repeated keydown Identify held-key behavior for diagnostics and tests
composing Whether an IME or dead-key composition may be producing text Mark composition-sensitive events so handlers do not act prematurely
keyCode A deprecated, implementation-dependent numeric value Keep it only for compatibility diagnosis

Because the finder retains only the latest event until the page changes or reloads, bulk collection is an export-after-each-capture process. If the required deliverable is an all-key lookup list, this is the tool's hard limit: it does not provide that output.

Match key, code, and location to the behavior

Use key when a shortcut should follow the character or named action produced by the current layout. Use code when the application depends on physical placement, such as WASD movement controls. On a US layout, the same physical key may report 2 or @ depending on Shift, while another layout can produce a different character. The physical code normally remains stable across those layout changes.

Scenario Primary fields Reason
Shortcut follows a typed character key The result reflects the active layout and modifiers
Game movement stays on physical WASD positions code Placement matters more than the character printed on the key
Left and right modifiers or Enter must differ code and location Both fields expose the relevant side or placement
A held key emits repeated events repeat and key The record identifies the repeated keydown and its meaning
An IME or dead key may be composing text composing and key The handler can defer an action until composition finishes
An older implementation must be diagnosed keyCode The legacy value is included but is not suitable as a modern standard

For a deeper field-by-field reference, see the guide to decoding KeyboardEvent values.

Build a bulk fixture collection

Use this procedure when the goal is a local collection of keyboard records rather than a universal keycode chart.

  1. Define the fixture inventory. List every key, combination, modifier side, navigation key, function key, numpad key, or input-method case your feature supports. Include only distinctions that affect behavior.
  2. Open the bordered capture area safely. Click or tab to it so it is deliberately focused. Nothing typed outside that area is observed, and you should avoid entering passwords, recovery codes, or other secrets. Tab remains available for moving focus away, while other keys have their default action canceled only while the capture target is focused.
  3. Press one key or combination. The focused keydown becomes the current record. Press the specific physical side when a fixture distinguishes left from right.
  4. Review every relevant field. Compare key with code, then check location, the modifier list, repeat, composing, and the legacy keyCode warning.
  5. Copy the formatted JSON. Use the record as a diagnostic or local test fixture, not as a universal compatibility guarantee.
  6. Save the record before pressing again. Because the finder holds only the latest event, name and store each copied JSON object in a local checklist. Then repeat the capture for the next item in the inventory.
  7. Assemble the saved records manually. Place the objects in a JSON array yourself; the finder does not merge them. Validate or prettify the combined text with the JSON Formatter.
  8. Test the collection on real targets. Run the fixtures in the exact browsers, operating systems, layouts, assistive technologies, and input methods your feature supports. Real devices remain the final compatibility check.

Preserve layout and side-specific data

A bulk dataset can become unreliable when layout-dependent values are collapsed into a universal character table. Keep separate captures for separate layouts, and record the target layout alongside the saved fixture as your own metadata. Do not rewrite a captured key into an assumed ASCII or Unicode value.

Use location to preserve meaningful physical distinctions. It can identify standard, left, right, and numpad variants, which matters for Shift, Control, Alt, Meta, Enter, and numeric keys. The modifier list is only the state included in that event; it is not a global history of every modifier pressed during the session.

Handle repeat and composition as event states

The repeat value becomes true when the operating system or browser emits repeated keydown events while a key is held. It should not be interpreted as proof of a particular keyboard model or as a general count of how long the key was pressed. Keep it with the captured key and code so repeated physical input can be distinguished from another key.

The composing value indicates that an input method editor or dead-key composition may be producing text. Shortcut handlers should often wait until composition is complete before acting, because a partial composition can make the apparent meaning of the event misleading. Mobile virtual keyboards may expose fewer code values because they do not represent a physical key position.

Treat keyCode as compatibility evidence

The MDN KeyboardEvent keyCode documentation marks keyCode as deprecated and implementation-dependent, while UI Events does not define reliable modern values for it. Printable-key behavior has differed across browsers and layouts. New application code should use key or code, according to the behavior it needs.

Do not infer ASCII, Unicode, or a typed character from keyCode. A value of zero does not necessarily mean that no key exists; it may mean that the legacy property cannot identify the key. In a bulk diagnostic set, retain key and code beside keyCode, label the latter as legacy data, and use it only to investigate compatibility with older implementations.

Test the set on real target environments

Synthetic KeyboardEvent fixtures are useful for repeatable logic, but they are not trusted user input and may not reproduce native platform behavior. A passing automated fixture does not replace a check on the exact target systems. Test each supported keyboard layout, operating system, browser, assistive technology, and IME when those combinations are part of the supported feature.

Browser-reserved shortcuts, operating-system shortcuts, accessibility technology, password managers, remote desktops, and input methods can intercept events before the page receives them. Provide an alternate clickable control for essential shortcuts, document conflicts, and never make one physical keyboard layout the only way to complete a critical action.

Finally, treat the captured JSON as diagnostic evidence or a local test fixture. The finder is useful for creating an auditable bulk collection one deliberate event at a time, but it does not turn deprecated values into a universal keycode chart or replace compatibility testing on real devices.