Bacteria use a range of sensory systems to mount appropriate responses to their environment. A new study now shows that the opportunistic pathogen Pseudomonas aeruginosa uses its type IV pili (which are composed of pilin subunits and are mainly used for surface motility) to sense contact with a surface and trigger a downstream signalling cascade that regulates virulence. The authors find that the process of pilus attachment and retraction functions as a mechanical cue that activates the Chp chemosensory system, thereby regulating the transcription of several important virulence factors. Notably, signal transduction is mediated by direct interactions between the major pilin subunit PilA and the chemosensor PilJ. These findings reveal a novel function for type IV pili that is probably important for promoting prolonged surface attachment and biofilm formation.