Specify custom behavior on keypress event.