Toggle with a capacitive sensor

I'm trying to get the logic right for a capacitive switch. The capacitive sensor library works great and it is easy to turn something on and turn something off with the touch of the hand. I want to touch (turn on and leave on) and touch again (turn off and leave off). Would you please help with the logic of this? My 77 year old brain struggles. Thanks if you can help.