huh? on_esc works fine... just make sure you set it to NULL and within a while loop...eg...

 Code:
function main()
{
while(1)
{
on_esc=NULL;
wait(1);
}
}