check keycode for preventDefault