handle firefox's keypress events