コード、データと QRツール

Keycode Info

「Keycode Info」はコード、データと QRに使えるブラウザツールです。入力内容と結果は通常この端末内で処理され、登録は必要ありません。

ブラウザ内で処理登録不要プライバシーの説明 ↗

KEYBOARD EVENT INSPECTOR

Press a key

Click the panel to focus it, then press any key. The page reads the event without submitting or storing it.

Waiting for a key…

Focus the panel and press a key.

key
code
keyCode
which
charCode
location
repeat
modifiers

使い方

使い方

  1. Focus the event area and press any key, including modifier, function, arrow, or printable keys.
  2. Read the captured key, code, numeric codes, location, repeat, and modifier flags.
  3. Use the values in your keyboard handler, then press another key to replace the current result.

key and code answer different questions

event.key describes the value or action after keyboard layout and modifiers are applied, such as A or ?. event.code describes the physical key position, such as KeyA or Slash, and is usually stable across layouts. Use key for text or commands and code for physical shortcuts.

Legacy numbers are included for compatibility

keyCode, which, and charCode are deprecated browser properties. This page displays them because older applications and debugging sessions still expose them; new code should prefer key, code, and the modifier properties.

Capture stays in this browser

The page listens only while its event panel is focused. It does not record passwords, send keystrokes to a server, or keep a history. A browser or operating-system shortcut may be handled before the page receives it.

よくある質問

あわせて知りたいこと

What is the difference between key and code?

key is the resulting character or named action, while code is the physical keyboard position. For example, Shift + A reports key A and code KeyA.

Should I use keyCode in new JavaScript?

No. keyCode, which, and charCode are deprecated. Prefer key, code, and the modifier properties, while using the numeric fields only when inspecting legacy behavior.

Why did a shortcut not appear?

Browser, operating-system, or assistive-technology shortcuts can be handled before the page receives a key event. Focus the event panel and try a key that is not reserved by the browser.