fix createEvent for key events in firefox