factor out user key press