Someone asked me I hope you find it useful. It is a simple event receiver class that exits the program when the key ESC is pressed. it can be mixed with more complete event receivers easily, i guess. It simply calls the runtime to exit the program inmediately
The point is to properly check the pressing of the Esc key, it is intended to be directly used, as the exit call frees all the user memory, closes all the opened files and so on, is a quick way to end the program, and seems that all the underlying systems have their own way to handle the exit call. So it is safe. Anyway it can be modified to call closeDevice().
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt