initial keypress code