Toggle Command

Is there a toggle on/off command.

I can make a button that turns on a layer (when Right Mouse click), and has turn off layer (when Left Mouse click).

Can I have toggle layer on/off on a single Mouse click.

Example Right Mouse Click sends object to layer ‘cplane’, and Left Mouse Click toggles layer ‘cplane’ on/off.

Essentially I want to create cplanes as solid surfaces I can see and choose to align cplane with using a single button command I already have set up.

I believe I can create cplane list, but I would like a visual way to do this.