completed function for key enter, arrowup, arrowdown, pageup ,pagedown