Added keyup keydown handling