Rotary encoder as on/off button

Hi all,

I might be a bit out of my league here, but I have a little battery powered project which turns of with a toggle/flip switch and I use a rotary encoder for programming various settings. click used for progressing through the various steps, rotation for setting the value.
Mostly software driven.

I'm wondering if it's possible to use the rotary encoder for powering on/off the circuit by holding it for a second or two, like you would with some make of mobile phones etc.
I guess this needs a hardware circuit to function and distinguise between the short and long signals, to be triggered on release.

Not really sure what I'm searching for with this and pretty novice when it comes to building circuits in general.
Feel much more at home with coding as it stands :*

Any help or directions greatly appreciated! :blush:

There exist rotary encoder with knobs that can be depressed to activate a pushbutton. Usually these are used to select an entry but the pushbutton output could be used to trigger an electronic on-off switch, like this one: Pololu Pushbutton Power Switch SV (old version)