OK I show you a bit more.
The button is controlled by the BASIC code.
Shutdown is a piece of code that looks like that:
After you get the button interrupt in your code it does
0 REM long press power down
172 ALARM 0;
0 REM wait until button release
173 A = pioclr 9;
0 REM LED off
174 A = pioclr 20;
175 A = pioget 17;
176 IF A = 1 THEN 175;
177 W = 3
178 A = reboot
0 REM wait for reboot to happen
180 FOR E = 0 TO 20
181 WAIT 1
182 NEXT E
183 RETURN