JSFiddle - React, Tailwind, and code Playground

by Sergio Crisostomo

JavaScript

$(document).on('keydown', function(e) {
  console.log(e.which); // Retorna o número código da tecla
  console.log(e.altKey); // Se o alt foi Pressionado retorna true
  if ((e.altKey) && (e.which === 80)) { // Pesquisar (Alt + P)
    document.body.innerHTML = 'Abriu Pesquisa.';
  }
});