Barokit

⌨️JavaScript KeyEvent Code Viewer

Press any key to see its event properties in real time: key, code, keyCode, and which. Useful for shortcut development, game controls, form key handling, and IME input debugging.

🔒 Browser-basedNo watermarkNo signup

How to use

  1. 1Press any key on the page.
  2. 2Event properties show up live.
  3. 3Try Shift, Ctrl, and Alt combos too.

FAQ

What's the difference between key and code?+

key is the input result (e.g., 'A', 'ㄱ'); code is the physical key location (e.g., 'KeyA'). For shortcuts, code (physical position) is usually recommended.

Why is keyCode deprecated?+

It was an older standard with layout-dependent values. Modern code uses key and code.

How are Korean IME inputs handled?+

During Korean composition, key events fire differently. Use compositionstart/end events for separate handling.

How do I detect shortcuts like Ctrl+S?+

Check ctrlKey, shiftKey, altKey, and metaKey together. macOS usually uses metaKey (Cmd); Windows uses ctrlKey.

What about arrows, Enter, Escape?+

key returns clear names like 'ArrowUp', 'Enter', or 'Escape'.

Function keys (F1–F12)?+

key returns 'F1', 'F2', etc. Watch out — browsers intercept F1 (help) and F5 (refresh).

Related tools