Prepare for keyevents