When a capillary is half-filled with liquid and turned to the horizontal, the liquid may flow out of the capillary or remain in it. For lack of a better criterion, the standard assumption is that the liquid will remain in a capillary of narrow cross-section, and will flow out otherwise. Here, we present a precise mathematical criterion that determines which of the two outcomes occurs for capillaries of arbitrary cross-sectional shape, and show that the standard assumption fails for certain simple geometries, leading to very rich and counterintuitive behavior. This opens the possibility of creating very sensitive microfluidic devices that respond readily to small physical changes, for instance, by triggering the sudden displacement of fluid along a capillary without the need of any external pumping.