document.addEventListener(`keydown`, function(event) {
if (event.code == "KeyN") {
});
document.addEventListener(`keydown`, function(event) {
if (event.code !== "KeyN") return;
// Дальше ваш код
if (event.key.toLowerCase() !== "n") return;