Use the encoder to toggle onscreen button

I was wondering if there’s any way you could make the encoder turn off the actual on screen button? Because that’s how I would like to engage and disengage my system.
I thought that’s how it was always done but I guess not.