Added keypress event handlers