Added an event queue class to handle recording mouse and keyboard events