Added callback to process keypress events