Body movement often evokes strong changes in neural activity in visual brain regions. Some of this movement-related activity is locked to locomotion, while other activity is locked to the movements of particular body parts. Visual brain regions are thought to use information about body movements to suppress or emphasize specific visual stimuli that might be expected to accompany these movements. However, we do not fully understand how these movement-related signals arise. Here, we show that a cell type in the Drosophila visual system (LT52) is strongly activated when flies groom their heads. Notably, LT52 neurons are active during grooming, even in blind flies, indicating that these signals are partly non-visual in origin. The non-visual component of LT52 activity is correlated with the movement of the ipsilateral foreleg, indicating that it likely arises from foreleg proprioceptors or motor commands. Grooming responses in LT52 neurons are also partly visual in origin. This visual component is recruited by large, moving objects with vertically extended edges-visual stimuli that resemble the fly's leg as it sweeps across the eye during grooming. The connectome shows that LT52 is anatomically positioned to inhibit the neural networks involved in steering toward a visual object in the environment. Thus, we suggest that LT52 functions to prevent the fly from steering toward its own leg. Together, our results show how neurons in visual brain regions can acquire selectivity for specific movements or gestures, using a combination of visual reafference and internal self-motion signals.