ok so just make a copy of the default.c file and then delete the line::
if (!on_esc) on_esc = def_exit;
so that the engine never exits upon pressing escape ....
I am not sure whether there's a better way or not but this does work...
In addition u need to make some corrections to ur code...
in your function main() just add:
on_esc = NULL;