Instal ZYBERMART

Buka semua alat dari layar utama atau dock, di jendelanya sendiri. Alat yang pernah Anda gunakan juga bisa dipakai offline.

Pencari Keycode

Tekan tombol apa pun untuk melihat nilai event.key, event.code, keyCode, dan modifier JavaScript-nya.

Press any key

⌨

Click here first if nothing happens, then press a key.

CtrlShiftAlt / OptionMeta / ⌘

Recent keys

keycodekeyCodeModifiers
Keys you press will appear here.

Common keys

Keyevent.keyevent.codekeyCode
EnterEnterEnter13
EscapeEscapeEscape27
Space" "Space32
TabTabTab9
BackspaceBackspaceBackspace8
Arrow left / up / right / downArrowLeft …ArrowLeft …37–40
A–Za–zKeyA–KeyZ65–90
0–9 (top row)0–9Digit0–Digit948–57
F1–F12F1–F12F1–F12112–123

Example

document.addEventListener('keydown', (event) => {
  if (event.key === 'Escape') closeDialog();
  if ((event.ctrlKey || event.metaKey) && event.key === 's') {
    event.preventDefault();
    save();
  }
});

Frequently asked questions

What is the difference between key and code?

event.key is the character or action the key produces, which depends on the keyboard layout and Shift (for example "a", "A" or "Enter"). event.code is the physical key position, which stays the same on every layout (for example "KeyA").

Should I still use keyCode?

No. event.keyCode and event.which are deprecated and differ between browsers and layouts. Use event.key for text and shortcuts, and event.code for games or position-based controls. They're shown here for older code you may still be maintaining.

Why doesn't a key show up?

Some keys are handled by the operating system or browser before the page sees them, such as the Windows key, Print Screen, or shortcuts like Ctrl+W. The Fn key usually isn't sent to web pages at all.

Does it work on phones?

On-screen keyboards often report key as "Unidentified" and keyCode as 229 while typing. For reliable results, use a physical keyboard.

Masuk ke ZYBERMART

Simpan CV, invoice, flashcard, catatan, dan alat tersimpan Anda di semua perangkat. Gratis, dan semua alat tetap berfungsi sama tanpa akun.

atau

Tanpa kata sandi. Dengan masuk, Anda menyetujui ketentuan kami; lihat cara kami mengelola data Anda di kebijakan privasi.

Akun Anda

Saat keluar, salinan pekerjaan Anda tetap tersimpan di browser ini. Di komputer bersama, hapus data browser setelahnya.

Apa yang ingin Anda buat?

Desain

Media sosial

Dokumen

Belajar

Edit

Lihat semua 282 alat