Then you're overwriting on_esc yourself. This sample code works flawlessly:
Code:
#include <acknex.h>

function on_esc_event()
{
	printf("Oh yeah!");
	sys_exit(NULL);
}



Always learn from history, to be sure you make the same mistakes again...