I've been making use of the Skillbuilders Modal Page plug-in a fair bit recently, and I thought I'd share this little ditty on closing the dialog when the escape button is pressed.
I set the event to Key Release, using the 'document' DOM object.
The JavaScript condition is set to 'event.which = 27' - the ASCII translation of the escape key.
Finally, the true action closes the window, passing nothing back to the calling page
Of course, aside from the action - the same event can be captured if you're listening for the escape key for whatever reason.
Hope it helps.
I set the event to Key Release, using the 'document' DOM object.
The JavaScript condition is set to 'event.which = 27' - the ASCII translation of the escape key.
Finally, the true action closes the window, passing nothing back to the calling page
javascript:window.parent.$(window.parent.document).apex_modal_page('close','');>
Of course, aside from the action - the same event can be captured if you're listening for the escape key for whatever reason.
Hope it helps.