Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

287
Vistas
IE doesn't detect Prt Scn key's keyup event (keyCode: 44) before other keyup event fire

Here's my code

$(document).on("keyup", function(e) {
    console.log(e.key);
    if (e.key == "PrintScreen") {
        e.preventDefault();
        clearClipBoard();
    }
})

function clearClipBoard() {
    if (navigator.clipboard) { // Chrome or Edge
        navigator.clipboard.writeText(""); 
    }
    else if (window.clipboardData) { // Internet Explorer
        window.clipboardData.setData("Text", "");
    }
}

When the page loaded first time, or blur and focus back again, the keyup event of PrintScreen cannot be detected. But if I press other key first and then press the Prt Scn key, it can be detected successfully.

It only happens when using IE, when I using Chrome or Edge, it doesn't have this problem.

I've tried to trigger a keyup event of other key when the page focus back, but the Prt Scn key still cannot be detected.

$(window).on("focus", function() {
    $.alert("focus");
    let e = $.Event('keyup');
    e.key = 'a'; 
    $("body").trigger(e);
})

I found someome has the same question but no answer. IE 11 Print screen issue

Any one have any ideas what might be causing this issue?

about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda