Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

145
Visualizações
Javascript event check if events were triggered by the same user action

I want to check if two different events were triggered by the same user action. For example, I have a keydown event listener and a beforeinput event listener with an editable div. Is there a way I can check if both events were triggered by the same key press? I know I could do it in a hacky way checking the time between the events, but is there a reliable/deterministic way to know if the events were triggered by the same input from the user?

If not a specific property, is there maybe a more reliable way to increment an id number after each event loop or push a callback to the end of the stack after the event loop to know the events on the stack would have all needed to be added at the same time by the same user input before the user would have been able to press another key or do another action?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda