Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

138
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!