listen to keypress and input instead of keyup