Remove keydown event when not needed