Any way to make the Esc key close a form?

Hi. Is there any way to make the Esc key close an Add or Edit form instead of clicking the Close button? Thank you.