I would like for a single button to switch a battery-powered device on/off but I would also like the button to have other functionality once the device is switched on. For example, once switched on, a momentary press changes mode but holding down for 3 seconds switches the device off. This would normally be achieved using the microcontroller's sleep mode but the combined current consumption of the sleeping microcontroller, voltage regulator, etc may be hundreds of uA. Not great if the device is going to sit on the shelf for a few weeks/months.
I've attached a circuit of what could be a handy solution. When the circuit is off (e.g. when battery connected for first time), nothing is powered. Pressing the button switched on the circuit and the microcontroller must then immediately set two tri-state pins to GND and VDD to latch the circuit. The button then has no effect of the power and its state may be read with a third microcontroller pin. The microcontroller turn itself off by returning its GND and VDD outputs to Hi-Z.
Is this kind of circuit already common practice? All comments welcome.