Where is the code that handles the Escape key for SimpleApplication?

I’m trying to find the Java code (for Desktop/AWT) that handles the Escape key (requestClose) functionality for SimpleApplication, whereby pressing the “Esc” key on your keyboard closes the application. I found a SystemListenener and an AWTPanelsListener that defines a requestClose(boolean) method, but for the Desktop it just throws an IllegalArgumentException.

Any ideas where I can find this functionality?

There is a default binding named um… one sec…



to remove it.

tonegod’s post is probably more useful to your end results but since you asked for the code, I will show that too: