Update for new 'keypress' API.