How does Shift+Turn off disable the circuit of the calculator?
What happens is simply that when this combination is identified (by the exact same means a key combination for doing a regular operation is identified), the processor is put in sleep mode. The supply is never really turned off: there is still a minimum amount of circuitry kept active, but the main part of the processor is shut down, and very little current is consumed (but still a tiny bit).

So there is nothing particular made to identify the combination for putting the processor in sleep mode. The keyboard matrix is scanned and every key action triggers the right operation, including shut down. What is more special is the way to turn on the calculator. Because when the processor is sleeping, it can't scan the keyboard so the "on" key is typically a bit special and goes directly to a wake-up pin of the processor instead of being part of the matrix like the other keys.

The way to implement all that differs from calculator to calculator but the priciple stays the same. For low-end calcs, everything is implemented in hardware, in the chip itself, with some logic elements (gates, registers, etc...). For high-end calcs, this mechanism is triggered by the software which calls a special processor instruction that puts the processor into sleep. The processor, when sleeping, is not executing any instructions until the wake-up pin (the on key) is triggered.

This is rather simple, actually. No black magic involved.