Instalar o ZYBERMART

Abra qualquer ferramenta pela tela inicial ou pelo Dock, em uma janela própria. As ferramentas que você já usou também funcionam offline.

Descobridor de keycode

Pressione qualquer tecla para ver os valores JavaScript event.key, event.code, keyCode e modificadores.

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.

Entrar no ZYBERMART

Tenha seus currículos, faturas, flashcards, notas e ferramentas salvas em todos os seus dispositivos. É grátis, e as ferramentas funcionam igual sem conta.

ou

Não precisa de senha. Ao entrar, você concorda com os termos; veja como tratamos seus dados na política de privacidade.

Sua conta

Ao sair, uma cópia do seu trabalho fica neste navegador. Em um computador compartilhado, limpe os dados do navegador depois.

O que você quer criar?

Designs

Redes sociais

Documentos

Estudos

Editar

Ver todas as 282 ferramentas