Adding keyup and keydown events.