add keypress functionality