When we have mouseclicks and keystrokes within 5 seconds window the ordering of the events gets messed up. To resolve the issue we had two solutions we discussed
- We can track the mousclick events. as soon as there is a mouseclick events we will stopped the keystroke listener and wrap up the contents of keystrokes.
- Another solution is to keep track of the start of the keystroke events and when they are ending it.