Diese Seite ist noch nicht auf Deutsch verfügbar, daher zeigen wir die englische Version.

JavaScript Keycode Finder — Key Event Info

Press any key and instantly see every property of the keyboard event, with a copy-ready keydown snippet for shortcuts.

Aktualisiert am
Press any key…
History

Deine Daten verlassen nie deinen Computer. Die Verarbeitung erfolgt zu 100 % lokal im Browser.

So nutzt du: JavaScript Keycode Finder

  1. Click the box (or anywhere on the page) and press a key or shortcut.
  2. Read event.key, event.code and the legacy keyCode.
  3. Copy the generated keydown handler for your shortcut.

key, code and keyCode

PropertyWhat it tells youUse it for
event.keyThe character or key name produced, respecting layout and Shift ("a", "A", "Enter")Text input, “type ? for help”
event.codeThe physical key position, independent of layout ("KeyA", "Digit1")Games (WASD) and position-based shortcuts
event.keyCode / whichLegacy numeric codes (Enter = 13, Esc = 27)Old code only — deprecated
event.location0 standard, 1 left, 2 right, 3 numpadTelling left/right Shift or numpad keys apart

Common key codes

Keyevent.keyevent.codekeyCode
EnterEnterEnter13
EscapeEscapeEscape27
Space" "Space32
TabTabTab9
BackspaceBackspaceBackspace8
Arrow keysArrowLeft/Up/Right/Downsame37–40
A–Za–z / A–ZKeyA–KeyZ65–90
0–90–9Digit0–Digit948–57
F1–F12F1–F12F1–F12112–123

Writing shortcut handlers

Check modifiers explicitly (e.ctrlKey || e.metaKey covers Ctrl on Windows and ⌘ on macOS), call e.preventDefault() only for shortcuts you handle, and skip your handler while the user types in inputs. Prefer key for letter shortcuts so they follow the user’s keyboard layout, and code when the physical position matters.

Test regular expressions for key handling in the regex tester, or check how the browser identifies itself with the user agent parser.

Auch gesucht als: javascript keycode, keycode list, event.key, event.code, keyboard event viewer, key code checker, keycode finder.

Passende Tools zu: JavaScript Keycode Finder

  • Online HTML Editor — A lightweight code playground: edit HTML, CSS and JavaScript side by side, see the result instantly, read console output and download your page as one HTML file.
  • JavaScript Formatter — Unminify and pretty-print JavaScript, JSON or JSX with your preferred indentation and brace style — or strip whitespace and comments with a verified minifier.
  • What Is My Screen Resolution — Your screen and browser window sizes in CSS pixels, the device pixel ratio and the real physical resolution — measured live by your browser.
  • HTML Formatter — Paste minified or messy markup and get clean, consistently indented HTML — including embedded <style> and <script> blocks.

Häufige Fragen

Should I use keyCode?
No. keyCode and which are deprecated. Use event.key for the character and event.code for the physical key.
What is the keycode for Enter?
Enter has keyCode 13, key "Enter" and code "Enter" (or "NumpadEnter" on the numeric keypad).
Why does Ctrl+W close the tab?
Some browser shortcuts cannot be intercepted by web pages for security reasons, including Ctrl+W, Ctrl+T and Ctrl+N in most browsers.
Kann ich JavaScript Keycode Finder als Web-App installieren und offline nutzen?
Ja. JavaScript Keycode Finder ist eine installierbare Web-App (PWA) – sie wird über Ihren Browser installiert und nicht aus einem App-Store heruntergeladen. Klicken Sie oben auf dieser Seite in Chrome oder Edge (Windows, macOS, Linux, ChromeOS) auf „App installieren“ oder verwenden Sie auf Android-Geräten „Teilen“ → „Zum Startbildschirm hinzufügen“ auf dem iPhone und iPad bzw. „Datei“ → „Zum Dock hinzufügen“ in Safari 17+ auf einem Mac. Die App öffnet sich dann in einem eigenen Fenster mit einem eigenen Symbol, und da sie vollständig in Ihrem Browser ausgeführt wird, funktioniert sie auch offline. Firefox auf dem Desktop kann keine Web-Apps installieren. So funktioniert die Installation.

Ähnliche Tools