Any python pros out there?

I was wondering if it is possible to run a script when pressing the “esc” key. need some help.
Please e-mail me if willing to help. It’s a very short script.
[email protected]

If I’m not wrong. You can set the quit key of the engine in settings (or was it in the render panel?). You can do that to avoid the engine to stop when you press ESC. be Sure to put Another key or to have a Another way
to end the game. Well, after that you can go on as usual with Another key. With an ALWAYS sensor that executes a script that detects the keypressing or by a key sensor for the esc key.

the fast way is to insert a new input key configuration in blender userpreferences / input and then select where you script will be available