The series of events in which a stimulus from a fungus is received and converted into a molecular signal.