I have this on my program:
?IFDEF IPHONE
ALLOWESCAPE FALSE //not sure if this is necesary on the iPhone, but here it is
?ELSE
ALLOWESCAPE TRUE //I want ESC working on the PC
?ENDIF
mainloop:
repeat
IF pausao=1
REPEAT
HIBERNATE
UNTIL pausao=0
DRAWRECT 192,142,130,30,rrgb
ALPHAMODE -1;PRINT "P A U S E D",200,150
SHOWSCREEN
REPEAT;UNTIL MOUSEAXIS(3)=1
REPEAT;UNTIL MOUSEAXIS(3)=0
ENDIF
rest_of_my_things
until "always"
SUB GLB_ON_PAUSE:
pausao=1
ENDSUB
SUB GLB_ON_RESUME:
pausao=0
ENDSUB
It works on the iPhone AND in the PC if I press outside the app window