Transcription factor that plays a crucial role in external sensory organ (ESO) that elaborates from a single precursor cell (ESOP cell). Mediates the differentiation of lineage branch that generates the internal 'ES' and 'th' cells (external sensory neuron and thecogen cells, respectively) from the IIIB cell. Its absence leads to re-specification of IIIB daughter cells into external tormagen cells (tr cells), or internal multidendritic neurons (MD cells). One of its role in the development of the ESO lineage is to modulate the activity of Notch and PAX2 signals. Expressed in the developing peripheral nervous system (PNS). Expressed in the ventral patch in the cephalic region of the embryo from stage 5, and continues in cephalic region through stage 15. Expressed in the developing PNS from stage 11 to 15, with a transient expression in each PNS cluster. In the ESOP lineage, it is first expressed in the IIIB cell, and in both ES and th cells, although it is only transiently expressed in th cells. In the ESOP lineage in the adult, it is also expressed in the IIIB cell and inherited by its daughter cells, as in the embryo. Was named 'hamlet' because of its 'to be or not to be' role in ESOP cells differentiation.