How to check if dialog was closed by ESCAPE key?

How to check if dialog was closed by ESCAPE key?

I'm using the Jquery UI dialog to popup some alerts and whatnot, and I'd like to be able to analyze the event object passed into my onClose handler, to determine whether the dialog was closed by the User pressing the Escape key (closeOnEscape = true).

Anyone know how to do this?